简体   繁体   中英

Automation of web application with Java Swing buttons

I have a web application in which some buttons are made by Java Swing. I am unable to see the element or DOM of the buttons. How do I find the elements? I am automating the application using Selenium.

If you are scripting your automation test using selenium you want be able to identity these buttons using selenium, But you can use an another API which has the ability of identifying the location of these buttons then use selenium web driver perform related actions. Sikuli is one recommendation with the assumption that the buttons has text or visual uniqueness. You can follow this tutorial for more information.

If there is SWING in HTML, I think you have Java Applet. In your Applet write below function:

clickButton(String name)

Implement above and find button in Java and call doClick .

You can use <applet-name>.clickButton(<button-name>) from JavaScript and so Selenium.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM