1
votes

I am scrapping a webpage that uses Java Applet. This applet generate a select tag and I want to click one of its options.
Selenium does find the element when I run:

doc_select = Select(self.driver.find_element_by_class_name('selectClass'))

If I inspect doc_select, I get:

<selenium.webdriver.support.select.Select instance at 0xb5a486ec>

And I can see that the driver has found all of the options in the debugger.
However, if I try to select one of the options using:

doc_select.select_by_value('9501')

It throws me the exception:

{ElementNotVisibleException}Message: Element is not currently visible and so may not be interacted with Stacktrace: at fxdriver.preconditions.visible (file:///tmp/tmpmxvBee/extensions/[email protected]/components/command-processor.js:10092) at DelayedCommand.prototype.checkPreconditions_ (file:///tmp/tmpmxvBee/extensions/[email protected]/components/command-processor.js:12644) at DelayedCommand.prototype.executeInternal_/h (file:///tmp/tmpmxvBee/extensions/[email protected]/components/command-processor.js:12661) at DelayedCommand.prototype.executeInternal_ (file:///tmp/tmpmxvBee/extensions/[email protected]/components/command-processor.js:12666) at DelayedCommand.prototype.execute/< (file:///tmp/tmpmxvBee/extensions/[email protected]/components/command-processor.js:12608)

Is there any way to interact with elements generated by Java Applet? How to make those applets elements visible to Selenium? There is some alternative to Selenium in which I can automate Java Applets?

1
As exception says selenium found the select box but due to visibility it could not be select...I think this is a HTML select box...you should try Webdriverwait to wait until select box visible...let me know if you have any problem...Saurabh Gaur
@SaurabhGaur I tried to wait for visibility, with no success. I had a similar problem when working with iframe, the error was the same, and I just needed to make selenium switch to frame. In this case however I cant make selenium to focus on the Java appletTales Pádua
Could you share your website url??Saurabh Gaur
@SaurabhGaur I cant because its a justice system website that requires a custom certificate to login, so you would't be able to visit itTales Pádua

1 Answers

0
votes

Is there any way to interact with elements generated by Java Applet?

no... Selenium can not interact with Java applets.