
测试相关
文章平均质量分 56
A内存
这个作者很懒,什么都没留下…
展开
-
Selenium学习---(二)
1. 如何导出网络的瀑布流。 首先:firebug中加载好export. 然后:在浏览器地址栏输入about:config,查找netexport. 其次:把extensions.firebug.netexport.alwaysEnableAutoExport设置为true. 再者:extensions.firebug.netexport.defaultLogDir是导出瀑布流的位置 再者原创 2015-08-23 14:06:06 · 433 阅读 · 0 评论 -
selenium2读书笔记(五)启动IE
首先,先下个IEDriver: http://www.seleniumhq.org/download/ 之后set property for IE DriverSystem.setProperty("webdriver.ie.driver", "pathofIEdriver\\IEDriverServer.exe");下面是一个完整的例子,当打开Google页面时,验证title。package原创 2017-03-29 10:42:04 · 185 阅读 · 0 评论 -
driver.close()和driver.quit()关闭浏览器
在关闭driver时用Driver.Quit();不要用Driver.Close();webDriver.Close(); //Close the browser window that the driver has focus ofwebDriver.Quit(); //Calls Dispose(), Quit this dirver, closing every associated w原创 2017-03-29 14:48:59 · 5484 阅读 · 0 评论 -
selenium2读书笔记(二)启动Chrome
前一篇文章里面写的是用driver打开本地的Chrome, 在一个项目中,大家本地的Chrome可能版本不一定相同,所以最好用diver打开同一个Chrome,这个Chrome可以放在工程里面。下面是具体的代码:public class TestCaseBase { private void setUpChrome() throws Exception{ File fileFor原创 2017-03-23 10:19:09 · 430 阅读 · 0 评论 -
selenium2读书笔记(三)Capabilities & ChromeOptions
https://sites.google.com/a/chromium.org/chromedriver/capabilitiesCapabilities are options that you can use to customize and configure a ChromeDriver session. This page documents all ChromeDriver suppor原创 2017-03-23 14:19:03 · 4207 阅读 · 0 评论 -
EventFiringWebDriver & Event Listeners in Selenium
https://www.seleniummonster.com/eventfiringwebdriver-and-event-listeners-in-selenium/Selenium提供了很多的event listening functions来跟踪脚本执行过程中的events.How it works? The Listeners use to listen for the events i翻译 2017-03-29 17:00:26 · 799 阅读 · 0 评论 -
Selenium webDriver之Scroll down
有些元素在页面的底部,需要下拉页面,才能看见元素,才能进行操作。//页面向下拉500pxJavascriptExecutor executor = (JavascriptExecutor) driver;executor.executeScript("window.scrollBy(0,500)");如果页面的长度不清楚,或者页面的长度是动态的呢? 我们可以先计算出页面的长度, 然后还是用上原创 2017-04-01 15:49:50 · 1410 阅读 · 0 评论 -
数据库基本知识
DDL(数据定义语言) create, alter, drop DML(数据操纵语言)insert, update, delete, select DCL(数据访问控制语言)grant, revoke数据模型3 要素:数据结构,数据操作,数据完整性约束原创 2017-04-01 14:31:20 · 2016 阅读 · 0 评论 -
JavascriptExecutor click invisible element in Selenium webDriver
https://www.seleniummonster.com/clicking-an-invisible-element-in-selenium-webdriver/有的时候,我们需要操作的元素是没有显示在页面上的,invisibe。这种情况下,driver.findElement().isDisplayed会返回true,但是,当你对这个元素进行操作,譬如click一下时,会返回cannot c原创 2017-04-05 14:12:26 · 335 阅读 · 0 评论 -
Selenium Page Object Model-FindAll annotation
可以用FindBy注释来代替driver.findelement(By x).//定义一个element@FindAll({@FindBy(xpath = "yourxpath")})public WebElement; resultElements;//一次定义多个elements@FindAll({@FindBy(xpath = "yourfirstxpath"),@FindBy(xpat原创 2017-04-01 15:17:55 · 599 阅读 · 0 评论 -
@optional annotation
在TestCaseBase的setUpBrowser方法里面可以用@optional注入参数的信息,如下:public void setUpBrowser(@Optional("2")String browserFlagO, @Optional("S")String environmentFlag, @Optional("en_US")String languageFlag0)throws Exce原创 2017-04-05 15:48:19 · 367 阅读 · 0 评论 -
TestNg实现失败自动重跑功能---WIP
参考了: http://www.seleniumeasy.com/testng-tutorials/execute-only-failed-test-cases-using-iretryanalyzer http://www.seleniumeasy.com/testng-tutorials/how-to-take-screenshot-for-only-failed-tests-using-we原创 2017-04-05 17:20:22 · 304 阅读 · 0 评论 -
TestNg实现失败自动重跑功能
参考了: http://www.seleniumeasy.com/testng-tutorials/execute-only-failed-test-cases-using-iretryanalyzer http://blog.youkuaiyun.com/sunnyyou2011/article/details/45894089大致分四步走: 一、先建个Java类实现IRetryAnalyzer接口。二原创 2017-04-05 17:19:43 · 679 阅读 · 0 评论 -
Testng实现用例失败自动截图
参考了: http://blog.youkuaiyun.com/sunnyyou2011/article/details/45894089 http://www.seleniumeasy.com/testng-tutorials/how-to-take-screenshot-for-only-failed-tests-using-webdriver大致分三步走: 一、先写个java类继承TestListene原创 2017-04-05 17:01:38 · 1138 阅读 · 0 评论 -
selenium2读书笔记(一)启动Chrome
1.安装并引用Selenium2 下载网址 http://seleniumhq.org/download/ 选一个下载。 之后解压。其中ThoughtWorks.Selenium.Core.dll—–Selenium 1的主要API文件; WebDriver.dll—–Selenium2的主要API文件。2.开始建项目 Eclipse–new–Java project; new cla原创 2017-03-22 10:39:15 · 343 阅读 · 0 评论 -
selenium2读书笔记(四)启动Firefox&设置profile&加载插件
http://www.cnblogs.com/puresoul/p/4251536.html一、启动firefox浏览器(不需要下载驱动,原生支持) 1.firefox安装在默认路径下://启动默认安装路径下的ff public void StartFireFoxByDefault(){ System.out.println("start firefox browser..转载 2017-03-26 20:36:11 · 985 阅读 · 0 评论 -
selenium测试相关的网站
http://www.abodeqa.com/2013/01/24/downloading-and-configuring-selenium-webdriver-in-eclipse-with-testng-plugin-installation/ 各种有关于selenium的博文原创 2016-04-20 14:41:09 · 391 阅读 · 0 评论 -
Selenium学习---(三)
关于XPath的学习 1.XPath 是XML 的查询语言,和SQL 的角色很类似。以下面XML 为例,介绍XPath 的语法。<?xml version="1.0" encoding="ISO-8859-1"?><catalog> <cd country="USA"> <title>Empire Burlesque</title> <artist>Bob原创 2015-08-23 20:37:58 · 323 阅读 · 0 评论 -
Selenium学习---(四)
Selenium参考手册 1.commands(命令) Actions(对当前状态进行操作,失败时,停止测试) Assertion(检验是否有产生正确的值) Element Locators(指定HTML中的元素) Patterns(用于模式匹配)2.Element Locators (元素定位器) id=id id locator 指定HTML 中的唯一id 的元素 name=n原创 2015-08-24 22:38:32 · 338 阅读 · 0 评论 -
Selenium学习---(五)
当selenium+testNG的框架的时候,有些testNG的知识需要记录一下。 http://www.yiibai.com/testng/ Annotation 描述 @BeforeSuite 被注释的方法将只在这个套件中的所有测试运行之前运行一次。 @AfterSuite 被注释的方法将只在这个套件中的所有测试都运行后,运行一次。 @BeforeClass 带注释的转载 2015-09-04 13:10:14 · 221 阅读 · 0 评论 -
selenium学习---(一)
一、用selenium IDE导出列子的顺序: 点击录制按钮,最后导出的时候,用java/JUnit/webDriver二、如何用eclipse创建一个工程: new–java project–填好name,选好JRE–next–选好libraiesi–add external JARS–finish()三、自己编程的情况: 1.例子,如何打开一个浏览器,输入网址ww.baidu.com 前原创 2015-08-23 11:17:45 · 349 阅读 · 0 评论 -
Selenium WebDriver---weiwan
命令和操作基于WebDriver driver = new FirefoxDriver();创建的一个driver实例: 1. 访问一个页面 第一件你想使用WebDriver做的事情肯定是访问一个页面,最基础的方法是调用“get”方法:driver.get("http://www.google.com");//或者下面的方法driver.navigate().to("http://www.g转载 2015-09-13 21:42:37 · 316 阅读 · 0 评论 -
selenium之By来定位元素
参考网址: http://www.seleniumhq.org/docs/03_webdriver.jsp#introducing-the-selenium-webdriver-api-by-example 1.跳转到页面:driver.get("http://www.google.com");2.定位元素: By.id<div id="coolestWidgetEvah">...</d原创 2016-01-26 15:22:12 · 1438 阅读 · 0 评论 -
selenium之二
参考网址: http://www.seleniumhq.org/docs/03_webdriver.jsp#introducing-the-selenium-webdriver-api-by-example 1.Moving Between Windows and Framesdriver.switchTo().window("window 名称");driver.switchTo().fram原创 2016-01-28 17:05:40 · 266 阅读 · 0 评论 -
selenium之三,各种driver
参考网址: http://www.seleniumhq.org/docs/03_webdriver.jsp#introducing-the-selenium-webdriver-api-by-example1.Selenium-WebDriver’s Drivers HtmlUnit DriverWebDriver driver = new HtmlUnitDriver();HtmlUnitDri原创 2016-01-29 13:37:04 · 493 阅读 · 0 评论 -
selenium之四, 各种wait--ing
参考地址: http://www.seleniumhq.org/docs/04_webdriver_advanced.jsp1.Explicit Waits显式等待 直到某个条件满足后,才进行之后的行为WebDriver driver = new FirefoxDriver();driver.get("http://somedomain/url_that_delays_loading");W原创 2016-01-29 15:00:18 · 278 阅读 · 0 评论 -
TestNG 安装过程
1.TestNG 是什么:TestNG,即Testing, Next Generation,下一代测试技术,是一套根据JUnit和NUnit思想而构建的利用注释来强化测试功能的一个测试框架,即可以用来做单元测试,也可以用来做集成测试。2.TestNG 如何安装: 输入:http://beust.com/eclipse/然后重启,就安装好TestNG了。3.TestNG 类新建 重启之后我们在测试原创 2016-01-19 15:35:29 · 498 阅读 · 0 评论 -
git的使用
1.>git init2.$ git status3.$ git add octocat.txt (把octocat.txt添加进了staging area)4.$ git status(就会显示new file: octocat.txt)5.$ git commit -m "Add cute octocat story"(类似于添加注释)6.$ git add '*.txt'(添加了所有原创 2016-03-19 16:02:12 · 256 阅读 · 0 评论 -
正则表达式小知识
下图是正则表达式的基本予语义。原创 2016-03-13 14:00:59 · 308 阅读 · 0 评论 -
xml学习(一)
1.对于xml文档来说,<?xml version="1.0"?>或者<?xml version="1.0" standalone="yes"?>必须要顶格写, 前面没有空格。standalone是指没有进行tdt校验的意思。如果没有写,也是默认没有校验。 2.<??>里面的属性的值用双引号或者单引号都可以。 3.xml元素可以有属性,属性形式为:属性名=“属性值”,如:gender=”male原创 2016-03-12 21:26:59 · 334 阅读 · 0 评论 -
如何写xpath的小笔记
1. Fuzzy search by fuzzy hierarchy //tagName[@attributeName='attributeValue']For examples: For following html:type="text" maxlength="25" name="userId" size="25" id="userId" class="inputB原创 2015-12-05 20:31:44 · 1125 阅读 · 0 评论