Selenium Webdriver java 积累一
Selenium Webdriver 学习:
http://jarvi.iteye.com/category/203994
https://github.com/easonhan007/webdriver_guide
Selenium WebDriver经验杂记:
http://blog.csdn.net/ant_yan/article/details/8185899
http://blog.csdn.net/aerchi/article/category/936247
1. Selenium Webdriver java 浏览器中前进,后退,刷新操作。
System.setProperty("webdriver.firefox.bin","D:/Mozilla Firefox/firefox.exe");
WebDriver driver = new FirefoxDriver();
driver.manage().window().maximize();
driver.get("http://www.google.com.hk");
driver.navigate().forward(); // 前进
driver.navigate().back(); // 后退
driver.navigate().refresh(); // 刷新
2. TestNG实例:
http://blog.csdn.net/yuxinlong2006/article/details/6765522
http://magustest.com/blog/automationtesting/webdriver-testng/
WebDriver+TestNG+ANT 实现多浏览器兼容性测试
http://www.51testing.com/?uid-375957-action-viewspace-itemid-817942
3. Webdriver 针对iframe中的元素定位
切换主页
用getWindowHandle()方法可以快速的进行切换回主页:String strMainHandler = driver.getWindowHandle();driver.switchTo().window(strMainHandler);关于iframe中 元素定位和xpath,cssSelector定位可参考:http://blog.csdn.net/dancedan/article/details/7406942
4. Webdriver中操作下拉列表
5. Webdriver 利用Actions类模拟鼠标和键盘的操作
6. webdriver 中 层级定位
参见:http://jarvi.iteye.com/blog/1448025
7. webdriver 执行js脚本
http://jarvi.iteye.com/blog/1447755
8. webdriver 等待页面加载完成
http://jarvi.iteye.com/blog/1453662
9. Webdriver 通过调用JavascriptExecutor 使对象隐藏对象出现,操作对象。
http://blog.sina.com.cn/s/blog_539a70d30101ajsg.html
10.Selenium中webdriver的quit()和close()区别
2. webDriver.Quit() - Calls dispose //调用dispose方法
3. webDriver.Dispose() Closes all browser windows and safely ends the session 关闭所有窗口,并且安全关闭session
Selenium Webdriver java 积累一的更多相关文章
- [selenium webdriver Java]常用api
1. 获取元素文本 WebElement类的getText()方法返回元素的innerText属性.所以元素里如果有子节点一样也会被返回出来.如下所示 public class GetText { @ ...
- [selenium webdriver Java]元素定位——findElement/findElements
策略 语法 语法 描述 By id driver.findElement(By.id()) driver.findElements(By.id()) 通过id属性定位元素 By name driver ...
- [selenium webdriver Java]隐式的等待同步
Selenium WebDriver提供了隐式等待来同步测试.当使用了隐式等待执行测试的时候,如果WebDriver没有在DOM中找到元素,将继续等待,超出设定时间后,抛出找不到元素异常 即,当元素没 ...
- Selenium WebDriver java 简单实例
开发环境 JDK 下载地址: http://www.oracle.com/technetwork/java/javase/downloads/index.html Eclipse: 下载地址:http ...
- Java 学习笔记 (二) Selenium WebDriver Java 弹出框
下面这段实例实现了以下功能: 1. profile使用用户本地电脑上的 (selenium 3有问题.因为selenium 3把profile复制到一个temp文件夹里,但并不复制回去.所以每次打开仍 ...
- Selenium webdriver Java 操作IE浏览器
V1.0版本:直接新建WebDriver使用 import org.openqa.selenium.WebDriver; import org.openqa.selenium.ie.InternetE ...
- Selenium webdriver Java firefox 路径设置问题
问题: Cannot find firefox binary in PATH. Make sure firefox is installed. 原因:selenium找不到Firefox浏览器. 方法 ...
- Selenium webdriver Java 高级应用
对于这一段还蛮有感慨的,只想说,代码还是需要自己去敲的. 1. 改变用户代理 import org.junit.AfterClass; import org.junit.BeforeClass; im ...
- Selenium webdriver Java 开始
最早接触的selenium是 selenium IDE,当时是为了准备论文.为了用IDE还下载了Firefox浏览器.后来接触过两个项目都需要selenium,一个采用selenium webdirv ...
随机推荐
- 初学者在ubuntu下安装使用git(下)
4.将代码传到oschina上去 之前已经将git配置完成了,现在通过ssh的方式访问资源库,先要用命令 ssh-keygen –C '你的邮箱' –t rsa .这样就会在ssh文件夹下建一相应的密 ...
- php之获取程序源码的方法
文件hello.php和index.php在同一目录 hello.php <?php class hello{ public function __construct() { echo 'hel ...
- MFCC特征提取(C语言版本)
音频分析中,MFCC参数是经典参数之一.之前对于它的计算流程和原理,大体上是比较清楚的,所以仿真的时候,都是直接调用matlab的voicebox工具或者开发的时候直接调用第三方库.最近想整理一个纯C ...
- java11
1:对象数组(掌握) (1)数组既可以存储基本数据类型,也可以存储引用类型.它存储引用类型的时候的数组就叫对象数组. (2)案例: 用数组存储5个学生对象,并遍历数组. 2:集合(Collection ...
- Angularjs 双向绑定机制解析
文章转自:http://www.2cto.com/kf/201408/327594.html AngularJs 的元素与模型双向绑定依赖于循环检测它们之间的值,这种做法叫做脏检测,这几天研究了一下其 ...
- MySQL的语句执行顺序
MySQL的语句执行顺序 MySQL的语句一共分为11步,如下图所标注的那样,最先执行的总是FROM操作,最后执行的是LIMIT操作.其中每一个操作都会产生一张虚拟的表,这个虚拟的表作为一个处理的输入 ...
- js 获取元素宽高
可以用源生js的.offsetHeight .offsetWidth属性 document.getElementById("temp_form").offsetHeight // ...
- nfs部署和优化
nfs--网络文件系统 1.说明:允许一个系统在网络上与他人共享目录和文件 2.好处:通过nfs服务,就可以让这个机器访问远程的文件,像访问自己的文件一样,属于cs通信 3.原理说明:假设有A,B ...
- FreeRTOS学习及移植笔记之二:在IAR和STM32F103VET上移植FreeRTOS
上一次,我们简单的测试了FreeRTOS的基于IAR EWARM v6.4和STM32F103VET6平台的Demo,对其有了一个基本认识.接下来我们开始自己移植FreeRTOS的过程. 1.创建一个 ...
- 25条提高iOS App性能的建议和技巧
这篇文章来自iOS Tutorial Team 成员 Marcelo Fabri, 他是 Movile 的一个iOS开发者. Check out his personal website or fol ...