mcdcorp / opentest

Open source test automation tool for web applications, mobile apps and APIs
https://getopentest.org
MIT License
452 stars 108 forks source link

How to access the driver using Java.type()? #607

Open TripleG opened 1 year ago

TripleG commented 1 year ago

If I want to do some direct interactions with the driver, how can I easily get it from within OpenTest script?

TripleG commented 1 year ago

Actually, I think I found the solution:

Java.type("org.getopentest.selenium.core.SeleniumHelper").getDriver();
adrianth commented 1 year ago

That's exactly what I was going to answer. :-) I don't know how you're planning to use the WebDriver instance from JavaScript, but if you're doing anything that's non-trivial you might want to create a custom OpenTest keyword instead (programmed in Java). See here for more details on that.