Selenium2+JUnit+FirefoxWebDriver
来源:互联网 发布:sql数据库设计实例 编辑:程序博客网 时间:2024/06/05 10:37
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{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+FirefoxWebDriver
- Selenium2+JUnit+FirefoxDriver操作页面中的选择按钮
- selenium2
- Selenium2学习
- selenium2.0
- selenium2.0
- selenium2笔记
- Python+Selenium2
- JUNIT
- junit
- Junit
- JUnit
- JUnit
- JUnit
- JUNIT
- junit
- Junit
- JUnit
- IMX6添加PCI接口的AR9580无线网卡驱动支持
- 【Cocos Creator基础教程(其他)】——原生平台退出游戏方法
- 图论算法总结
- jQuery实战学习笔记(二)-用jQuery为页面添加活力
- Hbase数据解析mapreduce过程及遇到的问题
- Selenium2+JUnit+FirefoxWebDriver
- 调用约定:_stdcall,_cdecl
- img之间的空白和img的对齐方式
- 学习笔记:jQuery的deferred对象整理1
- awk命令详解
- C++ 转换类型运算符 调用构造函数实现的类型转换
- java类中属性优先执行顺序
- 腐蚀和膨胀在opencv上的学习
- HDU1176-免费馅饼