1

I am writing the JMeter script for sampling the UI response time for each event using WebDriver Sampler plugin.

My application allows only certificate-auth access to the GUI. So my question is like can we load a custom profile for Firefox using WebDriverSampler or how can we handle the client-auth using WebDriver sampler

be it any browser (firefox/chrome/IE) etc....

I tried to update system.properties file under Jmeter3.0/bin/system.properties with below values.

#webdriver.firefox.profile=profileName

#jmeter -Dwebdriver.firefox.profile=profileName

but the profile doesn't load up and I get the error:

SECURE CONNECTION FAILED

Do we have the WebDriver-Sampler-Server.jar for JMeter ??

Or can we handle the same using JavaScript??

Adnan
  • 2,931
  • 3
  • 23
  • 35
Vikki Lohana
  • 39
  • 2
  • 10
  • I tried below :: var profiler=JavaImporter(org.openqa.selenium.firefox.internal.ProfilesIni) var ffprofile=JavaImporter(org.openqa.selenium.firefox.FirefoxProfile) var fdriver=JavaImporter(org.openqa.selenium.firefox.FirefoxDriver) var profile=new profiler.ProfilesIni(); var fprofile=profile.getProfile('profilName') WDS.browser = new fdriver.FirefoxDriver(fprofile); With the above the profile is opening and I can access the application but the Webdriver sampler is throwing the below exception java.net.MalformedURLException: unknown protocol: about – Vikki Lohana Jul 20 '16 at 10:03

3 Answers3

0

You may pass your firefox profile name as parameter to FireFoxDriver constructor like below and then create a jar file out of it and refer in Jmeter.

ProfilesIni profile = new ProfilesIni();
FirefoxProfile myprofile = profile.getProfile("profileName");  //Pass your profilename
WebDriver driver = new FirefoxDriver(myprofile);

Hope this helps

CARE
  • 618
  • 3
  • 11
  • Can you tell me the steps as I tried the same steps and placed the jar under the Jmeter lib/ dir but still facing the issue cannot load the profile – Vikki Lohana Jul 20 '16 at 06:25
0

Looking into:

it seems it is not possible using current version of WebDriver Sampler plugin with any browser.

So the options are:

  1. You can patch FirefoxDriverConfig file yourself to add the possibility to load i.e. Firefox Profile instead of creating it on the fly.
  2. You can switch to JUnit Request sampler which allows executing arbitrary JUnit tests right from JMeter. See How to Use JUnit With JMeter article for details on using JMeter and JUnit integration.
  3. You can write your Selenium code directly in JSR223 Sampler

NB: options 2 and 3 will require Selenium and dependency libraries presence in JMeter's classpath

Dmitri T
  • 159,985
  • 5
  • 83
  • 133
0

To run Selenium with custom profile we need to perform following steps -

First, we need to instantiate the inbuilt class in selenium "ProfilesIni". Load your custom profile with the help of getProfile() method. We actually are creating the clone of the custom profile. Now assign this custom profile to your webdriver instance.

// Instantiating the ProfilesIni ProfilesIni firefoxprofile = new ProfilesIni();

    // Loading the custom profile;

    FirefoxProfile myProfile = firefoxprofile.getProfile("SeleniumBix");

    // Creating web driver instance
    WebDriver driver = new FirefoxDriver(myProfile);

    //Opening the SeleniumBix in New profile
    driver.get("http://www.seleniumbix.com");

For more Datils you can refer this amazing tutorial - http://www.seleniumbix.com/#!firefox-profile-with-selenium-webdriver/cdci