Hi All,
I am currently trying to write an automation test script in python to find and interact with objects that are located on a JavaFX Webview window. I have seen the feature request thread which states that there is currently no support for JavaFX Webview controls but I have also seen that it is possible to interact with the Webview controls using the WebEngine object.
Is there a way of interacting with this WebEngine object within a python script or are there any other alternatives which would allow me to interact with objects on the JavaFX Webview window?
Kind regards,
Dineth
Solved! Go to Solution.
Yeah so the method worked, I was able to obtain the webEngine and its document. I've just got to work out how to find the elements on the page and interact with them.
This is the code I used, web_page was defined earlier and is the fullName of the WebView object in object spy.
web_engine = web_page.getEngine()
doc = web_engine.getDocument()
The solution provided is language agnostic. If you adapt it to Python syntax, best I can tell, it should still work.
Hi Robert,
Thanks for your reply. Do you have any ideas of how I would access the WebEngine object or find the name of it? Is this something that would come up in object spy or should I just try and set a variable to equal to xx.getEngine() and see how it goes?
Kind regards,
Dineth
Based upon my minimal knowledge, getEngine is a native method of the web view object. So, it's not part of TestComplete or anything. If you have a webview object, it should have the getEngine method. So... give it a try.
@tristaanogre thank you!
@dineth did you have a chance to actually try this? What are your results?
Hi Sonya,
I've been off work the past few days and haven't had a chance to try it yet. I'm going to have a look at it this week and I'll let you know how I get on.
Kind regards,
Dineth
Yeah so the method worked, I was able to obtain the webEngine and its document. I've just got to work out how to find the elements on the page and interact with them.
This is the code I used, web_page was defined earlier and is the fullName of the WebView object in object spy.
web_engine = web_page.getEngine()
doc = web_engine.getDocument()
Hi @dineth,
Happy to see that the question was resolved.
Subject | Author | Latest Post |
---|---|---|