cancel
Showing results for 
Search instead for 
Did you mean: 

JavaFX Webview support using python scripts

SOLVED
Highlighted
Occasional Contributor

JavaFX Webview support using python scripts

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?

 

Feature Request 

 

Possible WebEngine solution 

 

Kind regards,

Dineth

 

 

Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Occasional Contributor

Re: JavaFX Webview support using python scripts

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()

View solution in original post

7 REPLIES 7
Highlighted
Community Hero

Re: JavaFX Webview support using python scripts

The solution provided is language agnostic.  If you adapt it to Python syntax, best I can tell, it should still work.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Highlighted
Occasional Contributor

Re: JavaFX Webview support using python scripts

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

Highlighted
Community Hero

Re: JavaFX Webview support using python scripts

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.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Highlighted
Community Manager

Re: JavaFX Webview support using python scripts

@tristaanogre thank you!

 

@dineth did you have a chance to actually try this? What are your results?


Sonya Mihaljova
Community and Education Specialist

Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today
Highlighted
Occasional Contributor

Re: JavaFX Webview support using python scripts

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

Highlighted
Occasional Contributor

Re: JavaFX Webview support using python scripts

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()

View solution in original post

Highlighted
Community Manager

Re: JavaFX Webview support using python scripts

Hi @dineth,

Happy to see that the question was resolved.

---------
Tanya Gorbunova
SmartBear Community Manager

Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today
New Here?
Join us and watch the welcome video:
Announcements
Join TechCorner Challenge!
Want a fun and easy way to learn TestComplete? Try solving weekly TechCorner challenges and get into the Leaderboard!

Challenge Status

How to execute remote test and obtain results via Test Runner REST API

Participate!

Comparing content of HTML table with Excel file data

Participate!

Compare HTML table with Excel file and correct data in the file

Participate!

Retrieve Data from a Web Page

Participate!