Jmeter also does have a OS_Process_Sampler http://jmeter.apache.org/usermanual/component_reference.html#OS_Process_Sampler
So if you can get your Java Web driver in a self-contained executable jar you can just call it. I am actually trying to see if I can implement this over the next few weeks if I get some time. Beanshell is a great option for tiny manipulations to variables and such. However, it is not great if you are going to handle large data structures and need to pass them between thread groups(this can still be done with the use of Jmeter Properties but things can start to get real messy real quick). Regards, Matthew Pistella QA, Automation Engineer I KingsIsle Entertainment, Inc. -----Original Message----- From: David Luu [mailto:[email protected]] Sent: Thursday, February 19, 2015 12:07 AM To: JMeter Users List Subject: Re: Howto rewrite Java in JavaScript(Rhino engine) I see, then yes, Beanshell would be the better option. But be warned that Beanshell isn't exactly 100% Java syntax, therefore, depending on the exact Java code you need to run on Beanshell, some of it may have to be tweaked to run on Beanshell as I've encountered before, regarding sendKeys and executeScript. I don't know what other WebDriver Java API methods are affected. https://groups.google.com/forum/#!topic/webdriver/vlaBV7OO5Hs http://grokbase.com/t/gg/webdriver/127kf2h8n4/javascript-executor-issues-in-java-beanshell On Wed, Feb 18, 2015 at 9:05 PM, Bob <[email protected]> wrote: > Well, the problem is I wanted to use ChromeOptions which is not > implemented in ChromeDriverConfig, so decided to import Java classes. > Created StackOverflow question with code examples: > http://stackoverflow.com/questions/28581029/jmeter- > webdriver-plugin-mobile-emulation > > I think maybe it's better to use pure Java code with Beanshell sampler > as sebb mentioned. > On 19/02/15 09:52, David Luu wrote: > >> Unless the WebDriver sampler API/design has changed in newer versions >> and you're using an older version, perhaps you are not using it the >> correct way, or rather at least not the normal way? Have you tried >> using it the normal way? As suggested by the tutorial/documentation: >> >> http://jmeter-plugins.org/wiki/WebDriverTutorial/ >> http://jmeter-plugins.org/wiki/WebDriverSampler/ >> http://jmeter-plugins.org/wiki/ChromeDriverConfig/ >> >> It seems for the normal way, you configure ChromeDriverConfig element >> graphically/manually in JMeter, not from code (although there's no >> reason not to do it from code). Then you use the WebDriverSampler's >> object to work with WebDriver, not instantiate your own driver >> instance. So with the Chrome config defined manually in JMeter GUI, >> all your code needs to do are things like: >> >> var pkg = JavaImporter(org.openqa.selenium) var what = >> WDS.browser.findElement(pkg.By.id('what')) >> what.sendKeys(['tyres']) >> >> If it fails the normal way, it's a JMeter WebDriver plugin issue. If >> it just fails in your original code, then it's has to do with how you >> are calling WebDriver classes, but why go that route if you can take >> the normal route? >> >> On Wed, Feb 18, 2015 at 9:52 AM, Bob <[email protected]> wrote: >> >> I wanted to use with WebDriver sampler, it supports only JavaScript. >>> >>> On 18/02/15 18:17, sebb wrote: >>> >>> On 18 February 2015 at 11:52, Bob <[email protected]> wrote: >>>> >>>> Hi, >>>>> >>>>> I wanted to convert Selenium Java code to JavaScript make it >>>>> possible to run with JMeter >>>>> >>>>> Why convert? >>>> >>>> The BeanShell sampler runs most Java code. >>>> >>>> ------------------------------------------------------------------- >>>> -- To unsubscribe, e-mail: [email protected] >>>> For additional commands, e-mail: [email protected] >>>> >>>> >>>> >>>> ------------------------------------------------------------------- >>>> -- >>> To unsubscribe, e-mail: [email protected] >>> For additional commands, e-mail: [email protected] >>> >>> >>> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
