上一页 1 ··· 6 7 8 9 10 11 12 13 14 下一页
摘要: 我们除了使用java来直接运行junit之外,我们还可以使用junit提供的junit task与ant结合来运行。 涉及的几个主要的ant task如下: <junit>,定义一个junit task<batchtest>,位于<junit>中,运行多个TestCase<test>,位于<juni 阅读全文
posted @ 2016-07-15 15:25 月色深潭 阅读(6075) 评论(0) 推荐(0) 编辑
摘要: 利用下面的例子来编写测试脚本 页面代码: 脚本: 阅读全文
posted @ 2016-07-14 21:11 月色深潭 阅读(1690) 评论(0) 推荐(0) 编辑
摘要: 隐式等待相当于设置全局的等待,在定位元素时,对所有元素设置超时时间。 隐式等待使得WebDriver在查找一个Element或者Element数组时,每隔一段特定的时间就会轮询一次DOM,如果Element或数组没有马上被发现的话。 默认设置是0。一旦设置,这个隐式等待会在WebDriver对象实例 阅读全文
posted @ 2016-07-13 23:20 月色深潭 阅读(2637) 评论(0) 推荐(0) 编辑
摘要: 显式等待可以使用selenium预置的判断方法,也可以使用自定义的方法。 注: 1.除了以上内容,selenium还提供了很多预置的判断方法。 2.这些判断方法,在超出时间限制时就会抛出异常。 阅读全文
posted @ 2016-07-13 22:57 月色深潭 阅读(9451) 评论(0) 推荐(0) 编辑
摘要: 运行结果: CurrentUrl: https://www.baidu.com/Title: 百度一下,你就知道WindowHandle: {faa8c575-8918-457c-9765-0c227def08f4}hashCode: 112302969 阅读全文
posted @ 2016-07-13 22:51 月色深潭 阅读(717) 评论(0) 推荐(0) 编辑
摘要: 控制浏览器: http://www.cnblogs.com/moonpool/p/5657752.html 阅读全文
posted @ 2016-07-12 09:37 月色深潭 阅读(578) 评论(0) 推荐(0) 编辑
摘要: 1 package com.test.key; 2 3 import org.openqa.selenium.By; 4 import org.openqa.selenium.Keys; 5 import org.openqa.selenium.WebDriver; 6 import org.openqa.selenium.firefox.FirefoxDriver; 7... 阅读全文
posted @ 2016-07-12 08:19 月色深潭 阅读(952) 评论(0) 推荐(0) 编辑
摘要: 鼠标操作: 1.右击 2.双击 3.拖到 4.悬停 注:perform()的作用是 执行所有Actions中存储的行为。 阅读全文
posted @ 2016-07-11 23:44 月色深潭 阅读(8605) 评论(0) 推荐(0) 编辑
摘要: 1 package com.java.test; 2 3 import java.text.SimpleDateFormat; 4 import java.util.Calendar; 5 6 public class TimeS { 7 8 public static void main(Stri 阅读全文
posted @ 2016-07-11 17:13 月色深潭 阅读(40707) 评论(0) 推荐(0) 编辑
摘要: 使用默认方式构建的(WebDriver)FirefoxDriver实例: WebDriver driver = new FirefoxDriver(); 这种方式下,打开的Firefox浏览器将是不带任何插件的浏览器,和初始安装一样的状态。有时在测试中需要使用到预先保留的一些信息,比如Cookie中 阅读全文
posted @ 2016-07-11 08:26 月色深潭 阅读(9588) 评论(1) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 下一页