
selenium
z278718149
目前在做编译器工具链。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
webdriver学习
转载:http://www.360doc.com/content/12/0321/11/7479922_196219191.shtml 1.1 下载selenium2.0的lib包 http://code.google.com/p/selenium/downloads/list 官方User Guide:http://seleniumhq.org/docs/ 1.2 用we转载 2016-02-15 10:54:50 · 380 阅读 · 0 评论 -
定位元素
http://www.51testing.com/html/20/n-855520-2.html b、使用元素的任何属性来定位元素 driver.findElement(By.cssSelector("标签名[属性名='属性值']")); c、匹配部分属性值 ^= driver.findElement(By.css转载 2016-02-29 11:40:25 · 711 阅读 · 0 评论 -
XPATH
The XPath language provides a simple, concise syntax for selectingnodes from an XML document. XPath also provides rules for converting anode in an XML document object model (DOM) tree to a boolean, do转载 2016-03-03 16:48:07 · 458 阅读 · 0 评论 -
How to handle javascript alerts, confirmation and prompts?
http://www.seleniumeasy.com/selenium-tutorials/how-to-handle-javascript-alerts-confirmation-prompts Generally JavaScript popups are generated by web application and hence they can转载 2016-03-03 15:02:17 · 402 阅读 · 0 评论 -
css-selectors
https://saucelabs.com/selenium/css-selectors Selenium Tips: CSS Selectors This page will show you some CSS rules and pseudo-classes that will help you move your XPATH locators to C转载 2016-03-03 14:50:46 · 449 阅读 · 0 评论 -
Selenium WebDriver中一些鼠标和键盘事件的使用
在使用 Selenium WebDriver 做自动化测试的时候,会经常模拟鼠标和键盘的一些行为。比如使用鼠标单击、双击、右击、拖拽等动作;或者键盘输入、快捷键使用、组合键使用等模拟键盘的操作。在 WebDeriver 中,有一个专门的类来负责实现这些测试场景,那就是 Actions 类,在使用该类的过程中会配合使用到 Keys 枚举以及 Mouse、 Keyboard、CompositeActi转载 2016-02-15 11:26:05 · 507 阅读 · 0 评论 -
Selenium webdriver常用命令汇总
这段时间使用selenium webdriver做UI自动化,积累了一些心得,汇总了常用的命令。 1、查找某个元素是否存在: bot.existElement(By.xpath("//a[contains(text(),'宁波测试商品002')]")) 2、根据xpath断言某个元素是否存在: Assert.assertEquals(bot.findElements(By.xpat转载 2016-02-15 11:20:39 · 2816 阅读 · 0 评论 -
Selenium启动Chrome时,加载用户配置文件
Selenium操作浏览器是不加载任何配置的,网上找了半天,关于Firefox加载配置的多点,Chrome资料很少,下面是关于加载Chrome配置的方法: 一、加载所有Chrome配置 用Chrome地址栏输入chrome://version/,查看自己的“个人资料路径”,然后在浏览器启动时,调用这个配置文件,代码如下: #coding=utf-8 from seleniu转载 2016-02-15 11:13:17 · 3868 阅读 · 0 评论 -
Selenium+log4j+eclipse相关问题及解决方案
问题一: 如何获取新打开的浏览器窗口,用selenium进行UI自动化测试时,经常会遇到这个问题,现总结如下: // 存储现在窗口句柄 String winHandleBefore = driver.getWindowHandle(); //跳转到新打开的窗口 for(String winHandle : driver.getWindowHandles()){转载 2016-02-15 11:11:27 · 878 阅读 · 0 评论 -
Selenium如何分别启动IE、firefox、chrome浏览器
1、火狐浏览器 /* * 初始化火狐浏览器 * */ public static WebDriver initFireFox(WebDriver dr) { String key = "webdriver.firefox.bin"; String value = "C:/Program Files (x86)/Mozilla Firefox/firefox.exe"; System.转载 2016-02-15 11:00:48 · 5946 阅读 · 1 评论 -
selenium 基础1
selenium 通过id,name,class,css,xpath,tag,linktext,partial link 定位web 页面元素 文本框交互:可以通过SendKeys 方法把值转换成文本框内 单选按钮:可以使用click 方法选中按钮 复选框交互:可以使用click 方法选中按钮 下拉框交互:可以使用"selectByVisibleText"或"selectByIndex"或"se...原创 2018-08-16 11:05:11 · 290 阅读 · 0 评论