opentest icon indicating copy to clipboard operation
opentest copied to clipboard

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

Open TripleG opened this issue 3 years ago • 2 comments

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

TripleG avatar Feb 07 '23 15:02 TripleG

Actually, I think I found the solution:

Java.type("org.getopentest.selenium.core.SeleniumHelper").getDriver();

TripleG avatar Feb 07 '23 15:02 TripleG

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.

adrianth avatar Feb 08 '23 00:02 adrianth