打开浏览器HtmlUnit Driver优点:不会实际打开浏览器,运行速度很快。缺点:对JavaScript的支持不够好,有时会捕获不到页面元素。使用:WebDriver driver=new HtmlUnitDriver();Firefox优点:Firefox Driver 对页面的自动化测试支持...
分类:
Web程序 时间:
2015-07-11 18:20:04
阅读次数:
128
对于这一段还蛮有感慨的,只想说,代码还是需要自己去敲的。1.改变用户代理[java] view plaincopyimportorg.junit.AfterClass;importorg.junit.BeforeClass;importorg.junit.Test;importorg.openqa....
分类:
其他好文 时间:
2015-07-11 18:11:27
阅读次数:
416
最早接触的selenium是 selenium IDE,当时是为了准备论文。为了用IDE还下载了Firefox浏览器。后来接触过两个项目都需要selenium,一个采用selenium webdirver+junit4 +java,另外一个是采用 robot+selenium2library 。总体...
分类:
其他好文 时间:
2015-07-11 18:10:02
阅读次数:
110
1.简单查找By ID: WebElement element=driver.findElement(By.id("userId"));By Name:WebElement element=driver.findElement(By.name("cheese"));By TagName:WebEle...
分类:
其他好文 时间:
2015-07-11 18:07:40
阅读次数:
424
WebDriver对页面的操作,需要找到一个WebElement,然后再对其进行操作,比较繁琐:[java] view plaincopyWebElementelement=driver.findElement(By.name("q"));element.sendKeys("Cheese!");我们...
分类:
其他好文 时间:
2015-07-11 17:59:28
阅读次数:
140
import org.openqa.selenium.WebDriver;import org.openqa.selenium.ie.InternetExplorerDriver;import org.openqa.selenium.remote.DesiredCapabilities;import...
分类:
其他好文 时间:
2015-07-11 16:39:30
阅读次数:
126
从毕业到现在都是从事的功能测试工作,功能测试做久了,人就会比较迷茫。一直想着自学自动化测试,总以为只要学会LoadRunner或QTP这种商业级别的工具就算是会自动化测试了,所以就忙通一会,工具会用了也基本还是自动化测试的门外汉。 不甘心啊,就去泡各大论坛或博客,发现牛人们做的web自动化测试...
分类:
编程语言 时间:
2015-07-11 16:20:50
阅读次数:
169
selenium是一款很好的自动化框架,只需要简单的代码,便可对浏览器进行操作。很实用、很灵活、性能高,有什么理由不用它呢?
分类:
其他好文 时间:
2015-07-10 14:53:17
阅读次数:
115
昨天研读了虫师关于参数的使用,在做csv读取参数时遇到了一些问题,现记录如下1、报错,如图一直找不到原因,后来查到是保存csv文件出错,需要选择另存为,此错误就解决了
分类:
其他好文 时间:
2015-07-10 11:04:46
阅读次数:
78
>>> from selenium.webdriver.common.action_chains import ActionChains>>> setting = driver.find_element_by_xpath("//div[@id='u1']/a[7]")>>> ActionChains...
分类:
其他好文 时间:
2015-07-09 00:36:53
阅读次数:
88