selenium2(webdriver)的“兄弟姐妹”
1. web页面性能-browsermob-proxy
。这些数据可以被其他支出har的http分析工具使用,如firebug,httpwatch,fiddler等。通过这些数据,来分析网站的web前端性能瓶颈。
package seleniumTest;import java.io.File;
import java.io.IOException;import org.openqa.selenium.Proxy;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;import net.lightbody.bmp.core.har.Har;
import net.lightbody.bmp.proxy.ProxyServer;public class browsermobproxyTest {public static void main(String[] args) throws IOException {// TODO Auto-generated method stubProxyServer server = new ProxyServer(9097);server.start();Proxy proxy = server.seleniumProxy();DesiredCapabilities desiredCapabilities =new DesiredCapabilities();desiredCapabilities.setCapability(CapabilityType.PROXY, proxy);WebDriver driver=new FirefoxDriver(desiredCapabilities);//driver.get("https://www.baidu.com/");driver.manage().window().maximize();server.newHar("baidu");driver.get("https://www.baidu.com/");Har har=server.getHar();<span style="font-family: Arial, Helvetica, sans-serif;">//获取</span><span class="s1" style="font-family: Arial, Helvetica, sans-serif;">har</span><span style="font-family: Arial, Helvetica, sans-serif;">数据</span>File harFile = new File("/Users/apple/Documents/harbaidu.com.json");har.writeTo(harFile);server.stop();driver.close();}}
3) 生成的HAR文件harbaidu.com.json拖入下面的页面中:
2. jmeter
var pkg = JavaImporter(org.openqa.selenium)
var support_UI =JavaImporter(org.openqa.selenium.support.ui.WebDriverWait)
var wait = new support_UI.WebDriverWait(WDS.browser,5000)WDS.sampleResult.sampleStart()
WDS.browser.get('http://www.baidu.com/')var searchField = WDS.browser.findElement(pkg.By.id('kw'))
searchField.click()searchField.sendKeys(['jemter webdriver demo'])var button = WDS.browser.findElement(pkg.By.id('su'))button.click()WDS.sampleResult.sampleEnd()
selenium2(webdriver)的“兄弟姐妹”相关推荐
- Selenium2(WebDriver)总结(二)---Firefox的firebug插件参数设置(补充)
Selenium2(WebDriver)总结(二)---Firefox的firebug插件参数设置(补充) 本文是对上一节的补充:http://www.cnblogs.com/puresoul/p/4 ...
- Selenium2(WebDriver)总结(五)---元素操作进阶(常用类)
Selenium2(WebDriver)总结(五)---元素操作进阶(常用类) 1.Alert类 Alert是指windows弹窗的一些操作,需要new一个Alert类 driver.switchTo ...
- Selenium2(WebDriver)开发环境搭建(java版)
一.开发环境 1.JDK 2.Eclipse 3.Firefox 28.0 4.selenium-java-2.44.0.zip 解压后: 5.selenium-server-standalone-2 ...
- Selenium1 Selenium2 WebDriver
内容摘要: Selenium 1 原理 WebDriver WebDriver 组件 WebDriver 协议 Remote End 处理流程 Commands & Endpoints &am ...
- selenium2 webdriver要点理解
2019独角兽企业重金招聘Python工程师标准>>> webdriver实质要点:一套基于REST(json格式)的webdriver wire 协议完整规范,规范抽象出如何实现浏 ...
- Webdriver定位不到元素的解决办法
不知道怎么回事,先前能跑动的case,现在元素始终找不到. 但是我xpath是能定位得到的,debug了一下,结果发现在 WebElementelement = locator.findElement ...
- 总结Selenium WebDriver中一些鼠标和键盘事件的使用
在使用 Selenium WebDriver 做自动化测试的时候,会经常模拟鼠标和键盘的一些行为.比如使用鼠标单击.双击.右击.拖拽等动作:或者键盘输入.快捷键使用.组合键使用等模拟键盘的操作.在 W ...
- 一文玩转 WebDriver API
WebDriver API 进阶使用 元素定位 从之前的讲义和学习中,我们知道,WebDriver API的调用以及自动化测试,务必从页面元素的定位开始,那么回顾之前的内容,WebDriver提供了一 ...
- Selenium WebDriver API 进阶使用,模块化参数化进行自动化测试设计
2019独角兽企业重金招聘Python工程师标准>>> WebDriver API 进阶使用 元素定位 我们知道,WebDriver API的调用以及自动化测试,务必从页面元素的定位 ...
最新文章
- 自定义mysql8.0安装路径
- 1.uniq去重命令讲解
- PHP的自动加载__autoload spl_autoload_register
- python如何制作一个任意列表_在Python中扁平化任意嵌套列表的最快方法是什么?...
- spring mvc + ajax上传文件,页面局部刷新
- 将solidity智能合约打包成Java代码
- 持续集成CI, 持续部署CD, 持续交付CD要点
- 【语音识别】日语语音识别系统Julius(v4.4)的基于DNN的识别(5月8号:识别结果更新)
- 怎么查看linux系统硬盘,查看Linux磁盘空间的八大方法
- 面试通过,背调凉了。。
- WebGoat8 M17 Password Reset 密码重置 答案、思路、题解
- matlab 中 t=0:t:(n-1)t;k=0:n-1,如何用matlab画出单位脉响应h(n)=sin(n
- oracle 截取时间年或月
- (原創) 我也不JB了 (iPhone)
- js变量的重复声明问题总结
- 堆栈内存的分析以及作用域的详解
- python筛选时间范围_使用日期范围筛选模型
- 天池竞赛员工离职预测训练赛
- 计算机网络中rtd,网络RTK与网络RTD系统简介.ppt
- APP上线到360步骤
热门文章
- 详解Python-Numpy库的函数diagonal()【并附函数diagonal()与函数diag()的区别】
- 股市java_Java获取股市交易日
- DNS flood攻击分析
- 正弦值、余弦值和正切值
- Matlab缩进与空格
- React报错之React hook ‘useState‘ cannot be called in a class component
- 2021第十届深圳国际智能家居展览会
- 买一台 iPhone X,还是创建一家未来的独角兽?
- 《信号与系统》——连续傅里叶变换与拉布拉斯变换专题
- Kelvin connection-开尔文连接