1

I have below code

import org.openqa.selenium.By;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.openqa.selenium.chrome.ChromeDriverService;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import static org.openqa.selenium.support.ui.ExpectedConditions.*
import org.openqa.selenium.support.ui.*;
import openqa.selenium.OutputType.*;

// 1. Go to a page with a form
WDS.browser.get('http://mobile.yellow.com.au')
// 2. Enter characters into the text input field

WDS.browser.findElement(By.id('clue'))sendKeys('tyres')

And i am getting below error

javax.script.ScriptException: javax.script.ScriptException: groovy.lang.MissingPropertyException: No such property: org for class: Script32 at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:158) at java.scripting/javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:262) at com.googlecode.jmeter.plugins.webdriver.sampler.WebDriverSampler.sample(WebDriverSampler.java:99) at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:651) at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:570) at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:501) at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:268) at java.base/java.lang.Thread.run(Thread.java:1589)

Could some one please help

#jmeter #performance

2 Answers 2

0

I don't see any issues with your code, it runs just fine.

You can remove unnecessary imports and even get rid of them totally by putting fully qualified reference

// 1. Go to a page with a form
WDS.browser.get('http://mobile.yellow.com.au')
// 2. Enter characters into the text input field

WDS.browser.findElement(org.openqa.selenium.By.id('clue'))sendKeys('tyres')

If you still experience problems:

  1. Reinstall JMeter from scratch
  2. Add WebDriver Sampler only using JMeter Plugins Manager
  3. Restart JMeter to pick the plugin up
Sign up to request clarification or add additional context in comments.

1 Comment

I have used java script earlier as below 'wait.until(pkg.ExpectedConditions.presenceOfElementLocated(pkg.By.name('loginfmt')));' Could you please suggest how to do in groovy.
0

We had a similar issue and in the end it boiled down to (hidden) ClassNotFoundException. In our case it was apache-commons lang3 which was missing. In your case it could be org.openqa.selenium. Make sure the libs are available on your classpath.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.