Selenium2+JUnit+FirefoxDriver操作页面中的选择按钮
来源:互联网 发布:c语言base64编码 编辑:程序博客网 时间:2024/06/06 02:49
import static org.junit.Assert.*;import org.openqa.selenium.firefox.FirefoxDriver;import org.junit.After;import org.junit.Before;import org.junit.Test;import org.openqa.selenium.By;import org.openqa.selenium.WebDriver;import org.openqa.selenium.WebElement;public class testRadioButton {//提前声明private WebDriver driver;@Beforepublic void setUp() throws Exception{//firefox没有安装在默认路径要指定一下System.setProperty("webdriver.firefox.bin","D:/Program Files (x86)/Mozilla Firefox/firefox.exe");driver=new FirefoxDriver();driver.get("http://www.w3school.com.cn/html/html_forms.asp");}@Testpublic void testRadioButton() throws Exception{WebElement femaleRadioButton=driver.findElement(By.xpath("//*[@id=\"maincontent\"]/div[5]/form[2]/input[2]"));if(!femaleRadioButton.isSelected()){femaleRadioButton.click();}assertTrue(femaleRadioButton.isSelected());}@Afterpublic void tearDown() throws Exception{driver.quit();}}
0 0
- Selenium2+JUnit+FirefoxDriver操作页面中的选择按钮
- selenium2 python中的悬停操作
- Selenium2+JUnit+FirefoxWebDriver
- 浮动操作按钮的选择
- JFrame基本操作,增加选择文件按钮
- iOS webView 和 H5 页面交互(点击获取H5页面中的按钮,做自己想做的操作)
- 点击按钮弹出 蒙板 操作页面
- selenium2标准html控件操作
- Selenium2.0 WebDriver基本操作
- Selenium2鼠标点击操作笔记
- Selenium2操作浏览器的Cookies
- 关于 让页面中的按钮 响应回车
- 点击页面中的button按钮,界面刷新
- 点击按钮进入一个只能选择的页面
- js前台页面定位选择下拉框,单选按钮
- 页面上checkbox的选择操作
- selenium2
- 选择按钮
- innobackupex恢复操作报错两例
- 移动端开发:使用jQuery Mobile还是Zepto
- OC字符串去除首字母,OC字符串去除-号
- SearchView--搜索框案例
- 第12周【项目 1-实现复数类中的运算符重载(1)】
- Selenium2+JUnit+FirefoxDriver操作页面中的选择按钮
- 解决WORD “未找到引用源”问题
- ecshop二次开发各种文档下载
- LaTeX新人教程,30分钟从完全陌生到基本入门
- 膨胀和腐蚀在MATLAB中
- Linux 安装软件备忘录
- ubuntu下Qt cannot find -lGL错误的解决方法
- ssm(spring+springMVC+Mybatis)框架集成Mongodb
- https://github.com/hehonghui/android-tech-frontier