简体   繁体   中英

After integrating the selenium webdriver with jmeter with jar file using Junit request, jemeter does not handling windows authentication pop up

I'm facing an issue after integrating the selenium webdriver to jmeter (junit 4, jar file, Junit request).

After integration i was unable to handle the windows authentication pop up. Which means i was unable to open the browser.

These are all the steps i have done:

  1. Using eclipse,junit 4, selenium webdriver i have created test case which login into some website but for login type would be windows authentication.

  2. I have run the test case successfully in eclipse, i have exported this test case as a jar file and pasted into jmeter lib file. I have added additional libraries which are required to run the script.

  3. I have created a thread group for this i have added junit request sampler, and added listeners like results data, tree, summary report.

  4. And when i try to run the jmeter i'm getting the below error .

Thread Name: Thread Group 1-1 Sample Start: 1970-01-01 05:30:00 IST Load time: 0 Latency: 0 Size in bytes: 0 Headers size in bytes: 0 Body size in bytes: 0 Sample Count: 1 Error Count: 1 Response code: 9999 Response message: Failed to create an instance of the class:Login, reasons may be missing both empty constructor and one String constructor or failure to instantiate constructor, check warning messages in jmeter log file

Response headers:

SampleResult fields: ContentType: DataEncoding: null

  1. Kindly specify in what way we can achieve this?

Note: I want to reuse the already created scripts and do the load testing in jemeter.so only i have followed this approach.

REGARDS, VANI K

As per How to Use JUnit With JMeter guide

Constructor String Label

If your JUnit test class has a constructor which accepts a single String, you can set its value with this parameter. If your JUnit test class doesn't declare such a constructor, the JUnit Sample will try to look for an empty constructor.

So double check your Login class, it should:

  • either don't have a constructor

or

  • have constructor which takes only one String as a parameter.

Another reason could be clash of .jar files, both JMeter and Selenium depend on some Apache Commons libraries and these libraries versions are different. Once you copy Selenium libraries to JMeter's /lib folder carefully examine the folder and delete duplicate .jars keeping the ones with higher version.

Also be aware that starting from version 1.3.0 Selenium Integration plugin aka WebDriver Sampler supports languages other than JavaScript so it might be easier to consider using it for your purposes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM