2016年9月20日

Webdriver如何解决页面元素过期:org.openqa.selenium.StaleElementReferenceException: Element not found in the cache - perhaps the page has changed since it was looked up

摘要: 当运行Webdriver时抛出如下异常:org.openqa.selenium.StaleElementReferenceException: Element not found in the cache - perhaps the page has changed since it was loo 阅读全文

posted @ 2016-09-20 14:39 zw520ly 阅读(2382) 评论(0) 推荐(0) 编辑

2016年9月18日

Webdriver实现下载功能,屏蔽掉windows弹出的对话框,FireFox下设置浏览器的属性,两种实现方式:

摘要: 一、使用一个全新的FireFox浏览器打开Web应用,浏览器不带任何插件,也未对浏览器做任何默认配置,但需要对浏览器属性进行配置 // 获取浏览器的所有配置文件 ProfilesIni allProfiles = new ProfilesIni(); // "Selenium" 是之前创建的prof 阅读全文

posted @ 2016-09-18 23:15 zw520ly 阅读(2431) 评论(1) 推荐(0) 编辑

2016年9月17日

Webdriver的设计模式:Page Object(页面模型)

摘要: 设计思想:面向对象,将单个页面所有可能用到元素封装到一个page类中,并提供一些常用的方法,其属性就代表页面元素,普通方法代表对元素所做的操作 以博客园的登录页面为例: import org.openqa.selenium.By;import org.openqa.selenium.WebDrive 阅读全文

posted @ 2016-09-17 22:26 zw520ly 阅读(471) 评论(0) 推荐(0) 编辑

Webdriver+testNG+ReportNG+Maven+SVN+Jenkins自动化测试框架的pom.xml配置

摘要: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/P 阅读全文

posted @ 2016-09-17 22:14 zw520ly 阅读(2462) 评论(0) 推荐(0) 编辑

单元测试、自动化测试、接口测试过程中的Excel数据驱动(java实现)

摘要: import java.io.FileInputStream;import java.io.InputStream;import java.util.HashMap;import java.util.Iterator;import java.util.Map;import org.testng.As 阅读全文

posted @ 2016-09-17 21:09 zw520ly 阅读(2597) 评论(0) 推荐(0) 编辑

2016年9月15日

Webdriver中实现区域截图的方式以及如何截取frame中的图片

摘要: import java.awt.Rectangle;import java.awt.image.BufferedImage;import java.io.File;import java.io.IOException;import javax.imageio.ImageIO;import org.a 阅读全文

posted @ 2016-09-15 22:12 zw520ly 阅读(3285) 评论(0) 推荐(0) 编辑

2016年9月14日

webservice(soap)接口的加密,SHA-1实现

摘要: import java.io.UnsupportedEncodingException;import java.security.MessageDigest;import java.security.NoSuchAlgorithmException; public class SoapKey { p 阅读全文

posted @ 2016-09-14 23:19 zw520ly 阅读(1113) 评论(0) 推荐(0) 编辑

使用URL工具类调用webservice接口(soap)与http接口的实现方式

摘要: import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.Unsuppo 阅读全文

posted @ 2016-09-14 23:12 zw520ly 阅读(3731) 评论(0) 推荐(0) 编辑

导航