最新文章列表

WebDriver官方介绍

原文地址 WebDriver的介绍以及与Selenium1的区别 WebDriver is a clean, fast framework for automated testing of webapps. Why is it needed? And what problems does it solve that existing fra ...
lijingshou 评论(0) 有2163人浏览 2012-10-31 12:49

WebDriver(Selenium2)判断元素是否存在。

类似于Selenium1中的isElementExsit方法。 判断当前页面中是否存在某个期望查找的元素。 方法代码: public boolean isElementExsit(WebDriver driver, By locator) { boolean flag = false; try { WebElement element=driver.findElement(loc ...
uniquepig 评论(0) 有21692人浏览 2012-10-23 11:11

WebDriver(Selenium2)模拟鼠标经过事件

在自动化测试过程中,由于javascript的使用,我们常常需要点击一些鼠标经过显示的菜单等元素,这时需要触发该元素的鼠标经过事件。使用WebDriver有以下两种实现。 1.使用Action public void moveToElement(WebDriver driver, By locator) { Actions builder = new Actions(driver); ...
uniquepig 评论(1) 有8794人浏览 2012-10-22 17:28

WebDriver(Selenium2) 处理可能存在的JS弹出框

在自动化测试过程中,有些情况下我们会遇到一些潜在的Javascript弹出框。(即某些条件下才会出现,不是固定出现),然后如果当这种弹出框出现,我们没有加以处理,WebDriver将无法进行下一步的操作,并且会抛出NoAlertPresentException的异常(从2.16版本开始)。所以,使用以下方法可以处理潜在的1个alert(javascript弹出框)。 public boolean ...
uniquepig 评论(0) 有13484人浏览 2012-10-22 16:29

二、一个简单的官方实例

官方webdriver文档中简单的webdriver应用实例 package org.openqa.selenium.example; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa ...
SariyaLee 评论(0) 有1588人浏览 2012-09-27 21:42

OperaDriver

OperDriver OperaDriver是WebDriver厂商Opera Software和志愿者开发了对于Opera的WebDriver实现。 OperaDriver可以驱动浏览器对您的网页运行不通的测试,就像真实用于一样在他们之间导航。他可以模仿象点击链接,输入文字,提交表单的动作,并把结果报告给您,这样你就知道网站是否象您希望的那样工作。 OperaDriver的终端用户模拟确保了你的整 ...
shijunjuan 评论(0) 有1535人浏览 2012-09-25 09:58

一、Selenium2下载及使用

1.下载Selenium Client Servers包 在Selenium官网上可以下载到最新的开源的包http://seleniumhq.org/download/,根据编写测试脚本所使用的语言下载对应的包文件,本人学习用的是java语言,貌似就只有java有点基础了。^ ^ 2.学习文档 Javadoc是详细的Api,不懂的地方可以参考查阅。http://selenium.googlec ...
SariyaLee 评论(0) 有13278人浏览 2012-09-18 21:35

WebDriver介绍(一)

Selenium 2 (WebDriver) 介绍 Web应用的自动化测试 如今许多,可能所有的应用软件都是基于web的应用。这些应用的测试有效性在公司与组织 间相差甚大。在这 ...
shijunjuan 评论(0) 有2106人浏览 2012-09-15 21:08

使用WebDriver测试Flash

在网上看到一篇介绍如何使用WebDriver测试Flash的文章 http://learnseleniumautomation.blogspot.com/2011/12/driving-flex-application-via-selenium-2.html Flex应用需要使用ActionScript extension编译。没有测试过。如果以后需要,可以借鉴一下。 import org.o ...
shijunjuan 评论(0) 有2340人浏览 2012-09-14 16:35

【转】开源应用架构之​SeleniumWebDriver

开源应用架构之​SeleniumWebDriver   前不久,InfoQ向大家推荐了几本有关软件架构的新书,引起了国内读者的广泛兴趣。​其中一本是《开源应用架构 ...
rothmada 评论(0) 有1356人浏览 2012-08-14 16:29

WebDriver(Selenium2) 判断页面是否刷新的方法

public static boolean waitPageRefresh(WebElement trigger) { int refreshTime = 0; boolean isRefresh = false; try { for (int i = 1; i < 60; i++) { refreshTime = i; trigger.getT ...
uniquepig 评论(0) 有7656人浏览 2012-06-26 16:17

WebDriver(Selenium2) 常见异常及处理方法

Exception NoSuchElementException Solutions    1. Check the locator of your target element. 2. If the locator is current. Try to wait for page load before find element. 3. If already wait for long tim ...
uniquepig 评论(0) 有8440人浏览 2012-06-26 16:04

WebDriver(Selenium2) 根据新窗口title切换窗口

在webdriver官方的api中,切换窗口的方法提供的参数是nameOrHandle。引用WebDriver window(java.lang.String nameOrHandle)           Switch the focus of future commands for this driver to the window with the given name/handle. 但是 ...
uniquepig 评论(1) 有21578人浏览 2012-06-12 17:44

WebDriver(Selenium2) 判断页面是否出现某个字段的方法(Java实现)

类似于seleniumRC中的isTextPresent 方法 用xpath匹配所有元素(//*[contains(.,'keyword')]),判断是否存在包含期望关键字的元素。 使用时可以根据需要调整参数和返回值。 public boolean isContentAppeared(WebDriver driver,String content) { boolean status = fa ...
uniquepig 评论(0) 有8909人浏览 2012-06-12 17:10

揭秘WebDriver的实现原理(转)

通过研究selenium-webdriver的源码,笔者发现其实webdriver的实现原理并不高深莫测无法揣度。在这里以webdriver ruby binding的firefox-webdriver实现为例,简单介绍一下webdriver的工作原理。 当测试脚本启动firefox的时候,selenium-webdriver 会首先在新线程中启动firefox浏览器。如果测试脚 ...
shijincheng0223 评论(1) 有1870人浏览 2012-06-02 21:38

WebDriver之Modifier key

执行如下代码:   new Actions(driver).keyDown(Keys.CONTROL).keyDown(Keys.F5).keyUp(Keys.CONTROL).keyUp(Keys.F5).perform();  会报如下错误:   java.lang.IllegalArgumentException: Key Down / Up events only make s ...
lijingshou 评论(0) 有5291人浏览 2012-05-22 19:14

WebDriver键盘事件测试之文件上传(2)

需要在用WebDriver实现在页面点击某个按钮,然后上传文件到页面上,最开始的输入是点击页面上的“上传”按钮,这样就可以打开“File Upload”输入框 Actions action = new Actions(driver); //IE下双击,FF下单击.. action.doubleClick(driver.findElements(By.xpath("//input[@t ...
lijingshou 评论(1) 有10831人浏览 2012-05-22 18:48

WebDriver键盘事件测试(1)

按照我的理解,键盘事件主要有两类,一种是针对WEB页面上某个元素的,比如说百度首页搜索框输入文字,然后按回车。如果焦点在输入框上,输入回车就进行搜索,否则是不会进行搜索的。另外一种是单纯的键盘事件,不与任何WEB页面元素关联。 下面是在百度首页进行输入,按回车搜索的代码, IE8下测试通过,这个属于我说的第一种情况: driver = new InternetExplorerDriver(); ...
lijingshou 评论(0) 有1955人浏览 2012-05-22 13:49

WebDriver切换浏览器窗口

当测试页面同时出现2个或者以上窗口时候,而且新打开的window没有namem,可以使用driver.switchTo().window(winHandleID)来进行切换,如下代码已经在IE8中测试通过: //Store the current window handle String winHandleBefore = driver.getWindowHandle(); //Swi ...
lijingshou 评论(0) 有12016人浏览 2012-05-22 13:38

最近博客热门TAG

Java(141744) C(73651) C++(68608) SQL(64571) C#(59609) XML(59133) HTML(59043) JavaScript(54919) .net(54785) Web(54514) 工作(54118) Linux(50905) Oracle(49875) 应用服务器(43289) Spring(40812) 编程(39454) Windows(39381) JSP(37542) MySQL(37267) 数据结构(36424)

博客人气排行榜

    博客电子书下载排行

      >>浏览更多下载

      相关资讯

      相关讨论

      Global site tag (gtag.js) - Google Analytics