Re: [jmeter-plugins] Web Driver Sampler plugin problem

4,703 views
Skip to first unread message

Cheen-Pin Lim

unread,
Jan 2, 2014, 3:10:31 PM1/2/14
to jmeter-...@googlegroups.com

Hi

This is a recent known issue ACD we are in the most of trying to fix it. The options are either to downgrade to an older version of Firefox, use chrome instead, or wait for a fox from the JMeter plugins team.

Sorry for any inconvenience caused.

Regards
CP

On 3 Jan 2014 06:15, "Seth Barda" <sjb...@gmail.com> wrote:
Hi,

I am using Jmeter 2.9 and have installed the Web Driver Sampler plugin.  A problem I am having is that the firefox browser instance will open, but my test URL is not present in the browser and thus the page never loads.  The browser just remains in the same state until I shutdown the test.  Here is my test code.

WDS.sampleResult.sampleStart()
WDS.browser.get('http://www.google.com')
WDS.sampleResult.sampleEnd()

My Jmeter runs other tests ok.  Does any one know why this problem may be occurring?

Thanks,
  Seth

--
You received this message because you are subscribed to the Google Groups "jmeter-plugins" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jmeter-plugin...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Message has been deleted

Cheen-Pin Lim

unread,
Jan 4, 2014, 3:42:39 PM1/4/14
to jmeter-...@googlegroups.com

http://jmeter-plugins.org/wiki/ChromeDriverConfig/

On 4 Jan 2014 20:32, "Seth Barda" <sjb...@gmail.com> wrote:
Hi,

Appreciate the update.  Is there documentation on how to use the Chrome browser handy?

Thanks!
   Seth

Nupur Talwar

unread,
Jan 28, 2014, 5:31:54 AM1/28/14
to jmeter-...@googlegroups.com


Hey CP ,

Can you please specify which downgraded version of FF will run perfectly as I have downgraded from FF 26 to FF18 but still no luck . 

Cheen-Pin Lim

unread,
Jan 28, 2014, 6:06:30 AM1/28/14
to jmeter-...@googlegroups.com
Hi Nupur,

The version of Selenium WebDriver that ships with JMeter Plugins is v2.34. At that time, I think Firefox 22 was the current running browser (http://www.joecolantonio.com/2013/08/10/selenium-webdriver-version-2-34-0-released/). Let me know if that fixes your problem.

regards,
CP

jain.v...@gmail.com

unread,
Mar 4, 2014, 3:03:45 AM3/4/14
to jmeter-...@googlegroups.com

shachi...@gmail.com

unread,
Apr 29, 2014, 5:21:10 PM4/29/14
to jmeter-...@googlegroups.com
I have firefox 22 and Jmeter 2.6 and still doesnt work. Tried with Chrome as per the website and chrome opens up and crashes with this error 
Starting ChromeDriver (v2.9.248307) on port 4727
Starting ChromeDriver (v2.9.248307) on port 4751
chromedriver(79903,0xb128d000) malloc: *** error for object 0x7b842fd0: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Starting ChromeDriver (v2.9.248307) on port 3821

Cheen-Pin Lim

unread,
Apr 29, 2014, 6:24:04 PM4/29/14
to jmeter-...@googlegroups.com

Hi

If you are using the latest version of the WebDriver plugins, you should try the latest Firefox. Of this doesn't work please let us know and I can look into it.

With respect to chrome not working. Is that the current version of chrome driver?

Regards
CP

For more options, visit https://groups.google.com/d/optout.

shachi...@gmail.com

unread,
Apr 29, 2014, 6:35:54 PM4/29/14
to jmeter-...@googlegroups.com
Still does not work with latest FF and latest webdriver plugin.

Appreciate your help.

Cheen-Pin Lim

unread,
Apr 29, 2014, 9:00:15 PM4/29/14
to jmeter-...@googlegroups.com
Looks like there are API changes in the new Firefox. We will have to upgrade JMeter plugins with a new version. 

Thanks for letting us know.

CP

anujar...@gmail.com

unread,
May 1, 2014, 5:09:56 PM5/1/14
to jmeter-...@googlegroups.com

Hello,

This is a pretty late comment/reply/question on this post.

I just started using Webdriver plugin, and i just loved it. But it will take time for me to learn how to use it. While searching a solution for the problem i am facing i came to know about this post.

I am trying to use variables defined in jmeter inside Webdriver sampler.
I have defined two variables in jmeter in 'User Defined Variables' named 'username' and 'password'

As in one of the previous post Vincent explained below in textfield of the Webdriver Sampler I have added : '${username} ${password}' (with space in-between two parameters)
and below is my script:

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)
var username = WDS.args[0]
var password = WDS.args[1]

WDS.sampleResult.sampleStart()
WDS.browser.get('xxxxxxxxxxxxxxxxxxx')
var name = WDS.browser.findElement(pkg.By.id('UserName'))
name.click()
name.sendKeys(username)
var pwd = WDS.browser.findElement(pkg.By.id('Password'))
pwd.click()
pwd.sendKeys(password)
var button = WDS.browser.findElement(pkg.By.id('sign-in'))
button.click()
WDS.log.info(WDS.name + ' has logged an entry');
WDS.sampleResult.sampleEnd()

But still i am getting below error:
Response code: 500
Response message: javax.script.ScriptException: sun.org.mozilla.javascript.internal.EvaluatorException: Can't find method org.openqa.selenium.htmlunit.HtmlUnitWebElement.sendKeys(java.lang.String). (<Unknown source>#11) in <Unknown source> at line number 11

If you could please look into this.

Thanks,
Anuja

Cheen-Pin Lim

unread,
May 2, 2014, 3:32:44 AM5/2/14
to jmeter-...@googlegroups.com

Can you send the HTML snippet that you are trying to test? I can't see any problem at this point.

For more options, visit https://groups.google.com/d/optout.

anujar...@gmail.com

unread,
May 2, 2014, 10:52:48 AM5/2/14
to jmeter-...@googlegroups.com
This issue has been resolved.

There was a syntax error. Rather than below syntax

name.sendKeys(username)
pwd.sendKeys(password)

I changed it to
name.sendKeys([username])
pwd.sendKeys([password])

and it worked.

If you could tell me where can i learn the new syntax. As the syntax i use while coding in selenium 2 webdriver, its totally different than this.

Thanks.

anujar...@gmail.com

unread,
May 2, 2014, 12:52:03 PM5/2/14
to jmeter-...@googlegroups.com, anujar...@gmail.com
Hi CP,

I was just wondering, using jp@gc - HtmlUnitDriver Config and WebDriver Sampler

Would i be able to do load testing with 200 con-current users.

we are trying to stress test one of our application which is highly java scripted, so normal jmeter script doesn't work. I am trying to develop a stress test using webdriver plugin. But not sure if i would be able to do real stress testing with this.

Thanks,
Anuja

Cheen-Pin Lim

unread,
May 3, 2014, 8:33:23 PM5/3/14
to jmeter-...@googlegroups.com, anujar...@gmail.com

Hi

I haven't done this myself but you are more than welcome to try. I suspect you might need multiple jmeter instances.

Other people on this forum may have had more experience with this. Anyone?

CP

balendr...@gmail.com

unread,
Aug 6, 2014, 5:08:43 AM8/6/14
to jmeter-...@googlegroups.com
I am facing below issue while running tests using webdriver sampler:

2014/08/06 14:23:08 ERROR - com.googlecode.jmeter.plugins.webdriver.sampler.WebDriverSampler: sun.org.mozilla.javascript.internal.WrappedException: Wrapped org.openqa.selenium.WebDriverException: java.lang.InterruptedException: sleep interrupted
Build info: version: '2.39.0', revision: '14fa800511cc5d66d426e08b0b2ab926c7ed7398', time: '2013-12-16 13:18:38'
System info: host: 'riddenfish-l7', ip: '10.66.89.85', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_55'
Driver info: driver.version: unknown (<Unknown source>#18) in <Unknown source> at line number 18 

Line 18 in my test code is below:
wait.until(pkg.ExpectedConditions.visibilityOfElementLocated(pkg.By.linkText('yciPub16')))

and wait :
var support_ui = JavaImporter(org.openqa.selenium.support.ui.WebDriverWait)
var wait = new support_ui.WebDriverWait(WDS.browser, 6000)

Any help or suggestion to overcome this will be helpfull.

Andrey Pohilko

unread,
Aug 6, 2014, 7:21:00 AM8/6/14
to jmeter-...@googlegroups.com, balendr...@gmail.com
Please, don't resurrect old topics. Create new for your specific cases.

This is the second warning to you. 

--
Andrey

среда, 6 августа 2014 г., 13:08:43 UTC+4 пользователь balendr...@gmail.com написал:

Gande Vinay

unread,
Aug 30, 2023, 6:02:39 AM8/30/23
to jmeter-plugins

Hi Team,

Am using Javascript as a language and am trying to use the wait condition for my UI performance testing but am getting error everytime.

can you please help me out here please.

code:
var support_ui = JavaImporter(org.openqa.selenium.support.ui.WebDriverWait)
var conditions = org.openqa.selenium.support.ui.ExpectedConditions
var waitCondition = new support_ui.WebDriverWait(WDS.browser, 10)


Error:

Can not create new object with constructor org.openqa.selenium.support.ui.WebDriverWait with the passed arguments; they do not match any of its method signatures.

Thank you

Gande Vinay

unread,
Aug 30, 2023, 6:03:31 AM8/30/23
to jmeter-plugins

Am using chrome driver

Dmitri T

unread,
Aug 30, 2023, 6:19:09 AM8/30/23
to jmeter-plugins
Don't hijack old topics with irrelevant questions or comments, consider starting a new one instead.

Coming back to your question:
  1. Latest version of WebDriver Sampler (as of now) is 4.10.0
  2. It's shipped with selenium-support-4.10.0 
  3. According to WebDriverWait javadoc 2nd parameter is Duration
So you need to amend your code like

var waitCondition = new support_ui.WebDriverWait(WDS.browser, java.time.Duration.ofSeconds(10))

With regards to usage of JavaScript it might be not the best idea because Nashorn JavaScript engine was removed in Java 15  and you won't have possibility to run JavaScript code with newer Java versions. And in general it's recommended to use Groovy language for scripting
Reply all
Reply to author
Forward
0 new messages