JMeter running website open via Chrome

Source: Internet
Author: User
Tags blazemeter

Some website work on Chrome, but there is a problem running in the IE environment. Instead, use JMeter to run the website that you opened with Chrome.

You can refer to the following articles:

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

Extracts some of the key points are as follows:

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 C Onfig.

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) and then open Chrome Driver Conf IG and switch to Chrome tab and add path, it would is 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.ExpectedConditionsvarwait=new support_ui. Webdriverwait (Wds.browser,5) Var exception=NULLWDS.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 ('9') var loginbtn= WDS.browser.findElement (webdriver. By.ID('loginbtn_id') ) Loginbtn.click () varwait=new support_ui. Webdriverwait (Wds.browser,Ten)wait.until(Conditions.presenceofelementlocated (Webdriver. By.linktext ('Some Link Text')))

Run the tests!

You might has an error message like this 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 are duplicate files in your Lib folder, so if problem appear open JMeter Lib folder and make sure there are no Duplicates.

Like this:

Here is original StackOverflow solution.

For more information check out Blazemeter posts
1. The Webdriver sampler:your Top ten Questions answered
2. Using Selenium with JMeter ' s webdriver Sampler

In addition, the following two articles are basically derived from the previous article, if you feel it is necessary, you can also refer to:

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

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

This can be handled;

JMeter running website open via Chrome

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.