随笔分类 - Selenium
摘要:写了一段测试代码运行时一直报错:The method sendKeys(CharSequence[]) in the type WebElement is not applicable for the arguments (String)测试代码:driver.findElement(By.name...
阅读全文
摘要:使用Selenium操作浏览器,有时需要进行后退、前进和刷新操作,下面是示例代码:import org.openqa.selenium.WebDriver;import org.openqa.selenium.firefox.FirefoxDriver;public class SeleniumTe...
阅读全文
摘要:在使用webdriver操作页面元素的时候经常会遇到一些单选按钮的情况,例如:注册时性别选择。单选按钮族中所有按钮共享同一个名称,所以浏览器知道将按钮组合在一起,通过选中其中一个按钮,其他按钮自动变为未选中状态。示例代码:package com.seleniumdemo.webdriver;impo...
阅读全文