部分website在chrome上运行正常,但在IE环境运行会存在问题。而是用 JMeter运行通过chrome打开的website时候,需要处理一下。

可以参考下面几篇文章:

http://ninjawebzen.com/running-jmeter-with-chromedriver/

摘录部分要点信息如下:

Once download finished, extract zip archive somewhere temporary. Then open the folder where your JMeter located, navigate to ..\apache-jmeter-2.13\lib and paste all .jar files from WebDriver plugin ..\lib. Open ..\apache-jmeter-2.13\lib\ext and paste .jar file from WebDriver plugin ..\lib\ext.

Right click on a Test Plan => Add => Threads => Config Element => and make verify is presented Chrome Driver Config.

Now lets set the project:

1. Add Thread Group
2. Then Chrome Driver Config (right click on Thread Group => Add => Config Element => Chrome Driver Config)

You would need to specify location of chromedriver.exe (btw download it, if you haven't yet), then open Chrome Driver Config and switch to Chrome tab and add path, it would be something like:

C:\Users\your_username\apache-jmeter-2.13\lib\chromedriver.exe

3. Add WebDriver Sampler (right click on Thread Group => Add => Sampler => WebDriver Sampler)
And add some test code:

var webdriver = JavaImporter(org.openqa.selenium)
var support_ui = JavaImporter(org.openqa.selenium.support.ui.WebDriverWait)
var conditions = org.openqa.selenium.support.ui.ExpectedConditions
var wait=new support_ui.WebDriverWait(WDS.browser, )
var exception = null WDS.sampleResult.sampleStart()
WDS.browser.get('localhost:8080') var loginUrl = WDS.browser.findElement(webdriver.By.id('loginUrl_id'))
loginUrl.click() var userName = WDS.browser.findElement(webdriver.By.id('username_id'))
userName.sendKeys('admin')
var password = WDS.browser.findElement(webdriver.By.id('password_id'))
password.sendKeys('') var loginBtn = WDS.browser.findElement(webdriver.By.id('loginBtn_id'))
loginBtn.click()
var wait=new support_ui.WebDriverWait(WDS.browser, ) wait.until(conditions.presenceOfElementLocated(webdriver.By.linkText('Some Link Text')))

Run the tests!

You might have an error message like that on first run

2015/08/04 13:41:37 ERROR - jmeter.threads.JMeterThread: Test failed! java.lang.NoClassDefFoundError: Could not initialize class org.apache.http.impl.conn.ManagedHttpClientConnectionFactory

Then problem is duplicate files in your lib folder, so if problem appear open JMeter lib folder and make sure there is no duplicates.

like this:

Here is original stackoverflow solution.

For more information check out Blazemeter posts
1. The WebDriver Sampler: Your Top 10 Questions Answered
2. Using Selenium with JMeter's WebDriver Sampler

另外,下面这两篇文章基本是源自前一篇文章,如果觉得有必要,也可以参考:

https://guide.blazemeter.com/hc/en-us/articles/206732579-Chrome-Extension

http://www.cnblogs.com/liulinghua90/p/5822148.html

就这样处理即可;

JMeter运行通过Chrome打开的website的更多相关文章

  1. Jmeter运行badboy录制的脚本

    前言 进行性能测试的站点为:在本地搭建的bugfree 一.badboy录制脚本 1.启动bugfree服务 2.打开badboy进行脚本录制 2.1.打开badboy,按下启动录制按钮,在地址栏中输 ...

  2. Jmeter运行后,查看结果树中的响应数据出现中文乱码。

    参考:https://blog.csdn.net/qq_15228737/article/details/82597482 https://baike.baidu.com/item/UTF-8/481 ...

  3. Mac OS 您需要安装旧 Java SE 6 运行环境才能打开“XXX” 问题

    问题描述: 今天在Mac OS上安装一个app的时候提示 “您需要安装旧 Java SE 6 运行环境才能打开 XXX” ,在网上搜索了一下,有说要改app的info.plist文件的,将其中的JVM ...

  4. Mac下safari、chrome打开开发者工具快捷键

    mac下safari和chrome打开开发者工具的快捷键相同,都是option(alt)+command+i 这个是我的默认配置,没有更改过的.

  5. vue中npm run dev运行项目自动打开浏览器

    npm run dev运行项目自动打开浏览器设置自动打开浏览器 // 各种设备设置信息      host: 'localhost', //主机名      port: 8080, // 端口号(默认 ...

  6. 运行vs时打开一个浏览器窗口,而不是在原有窗口上打开一个标签

    1.运行vs时打开一个浏览器窗口,而不是在原有窗口上打开一个标签,结束调试时窗口又关闭了,特别麻烦. 在用swagger调试接口时,好不容易输入了测试数据,然而窗口关闭了,再次调试又得重新输入. 解决 ...

  7. Jmeter运行过程中如何让Fiddler同时可以抓获到服务器的应答报文

    在默认情况下,Jmeter运行过程中,Fiddler是抓不到对应的应答报文的. 但是,在某些时候,我们希望分析Jmeter执行失败的原因,想了解Jmeter获取到的应答报文是否有问题,就需要同服务器返 ...

  8. chrome 打开上次关闭的tab ctrl+shift+T

    chrome 打开上次关闭的tab ctrl+shift+T

  9. MAC 打开Chrome打开开发者工具的快捷键

    mac下safari和chrome打开开发者工具的快捷键相同,都是 option(alt)+command+i 这个是我的默认配置,没有更改过的.

随机推荐

  1. 转:iOS应用程序生命周期(前后台切换,应用的各种状态)详解

    iOS应用程序生命周期(前后台切换,应用的各种状态)详解 分类: iOS开发进阶2012-10-08 15:35 42691人阅读 评论(30) 收藏 举报 iosapplication任务anima ...

  2. UIWebView 大全

    <html> <head> </head> <body> <img src = "http://t1.baidu.com/it/u=10 ...

  3. 在arcgis使用python脚本进行字段计算时是如何解决中文问题的

    来自:https://www.jb51.net/article/73561.htm 一.引言 在arcgis打开一个图层的属性表,可以对属性表的某个字段进行计算,但是在平常一般都是使用arcgis提供 ...

  4. Android:调用其他程序中的activity和Permission Denial: starting Intent 错误解决办法

    今天想调试多个task中栈的情况,在测试程序中调用另一个程序的activity, 代码片段如下: btnStartX=(Button)findViewById(R.id.btnStartX); btn ...

  5. 自定义兼容多种Protobuf协议的编解码器

    <从零开始搭建游戏服务器>自定义兼容多种Protobuf协议的编解码器 直接在protobuf序列化数据的前面,加上一个自定义的协议头,协议头里包含序列数据的长度和对应的数据类型,在数据解 ...

  6. java List转换为字符串并加入分隔符的一些方法总结

    方法一: public String listToString(List list, char separator) { StringBuilder sb = new StringBuilder(); ...

  7. ios之两个view传值

    delegate:demo使用场景,我有A,B两个controller,A是root,跳转到B,B的数据输入完返回A且携带数据显示到A. A.h #import <UIKit/UIKit.h&g ...

  8. 数据更新后让ListView自动滚动到底部

    在做聊天界面的时候想要发送新的数据后,listview自动滚动到底部,显示出最新的数据.网上找了两个方法,觉得不错,记录一下. 方法一: 给listview添加下面两个属性 android:stack ...

  9. Guava CompoundOrdering

    概述 CompoundOrdering是Ordering的子类,它用来存储比较器链, Ordering的compound()内部实现就是使用 CompoundOrdering(Comparator&l ...

  10. ASP.NET Core开发-读取配置文件Configuration appsettings.json

    https://www.cnblogs.com/linezero/p/Configuration.html ASP.NET Core 是如何读取配置文件,今天我们来学习. ASP.NET Core的配 ...