上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 63 下一页
摘要: quit方法:退出相关的驱动程序和关闭所有窗口 close方法:关闭当前窗口 执行结果: baidu search handle : {75749f9a-f6b7-4fe6-80ae-dd9e053dd577}the link of news is : http://news.baidu.com/s 阅读全文
posted @ 2017-08-05 11:11 李清欣 阅读(1871) 评论(0) 推荐(0) 编辑
摘要: package com.test.screenshot; import java.io.File; import java.io.IOException; import org.apache.commons.io.FileUtils; import org.openqa.selenium.OutputType; import org.openqa.selenium.TakesScreensh... 阅读全文
posted @ 2017-08-05 11:10 李清欣 阅读(2625) 评论(0) 推荐(0) 编辑
摘要: 1. 操作滚动条 2.在textarea中输入内容 参考: http://www.cnblogs.com/tobecrazy/p/4817946.html 阅读全文
posted @ 2017-08-05 11:09 李清欣 阅读(2379) 评论(0) 推荐(0) 编辑
摘要: 下载文件需要在Firefox 的profile属性中配置一些参数,如下面的代码: 使用到的页面例子: <!DOCTYPE html><html><head><meta charset="UTF-8"><title>download</title></head><body> <a href="d.ex 阅读全文
posted @ 2017-08-05 11:08 李清欣 阅读(1542) 评论(0) 推荐(0) 编辑
摘要: 执行结果: 8alert("用户名是: name");9 阅读全文
posted @ 2017-08-05 11:08 李清欣 阅读(1331) 评论(0) 推荐(0) 编辑
摘要: 1. 当页面中是通过input标签实现上传功能时,可以使用selenium来上传功能。 如下: 2. 如果网页中的上传功能不是使用input来实现,那就需要使用其他方法来实现模拟 可以使用AutoIt录制脚本实现: 使用方法参考: http://www.cnblogs.com/fnng/p/4188 阅读全文
posted @ 2017-08-05 11:07 李清欣 阅读(1623) 评论(0) 推荐(0) 编辑
摘要: 下面代码中介绍了告警框的处理方法 实例例子: 阅读全文
posted @ 2017-08-05 11:06 李清欣 阅读(372) 评论(0) 推荐(0) 编辑
摘要: 采用下面的例子来编写用例 代码: 阅读全文
posted @ 2017-08-05 11:05 李清欣 阅读(630) 评论(0) 推荐(0) 编辑
摘要: 如果遇到点击按钮或链接后出现新窗口的情况,就需要使用窗口切换的方法。 本例中就是先打开百度搜索界面,然后利用js打开一个百度新闻界面,然后通过selenium提供的窗口切换方法切换窗口 运行结果: baidu search handle : {57536d1e-6817-4127-83d6-6eb1 阅读全文
posted @ 2017-08-05 11:05 李清欣 阅读(971) 评论(0) 推荐(0) 编辑
摘要: 利用下面的例子来编写测试脚本 页面代码: 脚本: 阅读全文
posted @ 2017-08-05 11:03 李清欣 阅读(391) 评论(0) 推荐(0) 编辑
上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 63 下一页