1

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/fxdriver@googlecode.com/components/command-processor.js:10092) at DelayedCommand.prototype.checkPreconditions_ (file:///tmp/tmpmxvBee/extensions/fxdriver@googlecode.com/components/command-processor.js:12644) at DelayedCommand.prototype.executeInternal_/h (file:///tmp/tmpmxvBee/extensions/fxdriver@googlecode.com/components/command-processor.js:12661) at DelayedCommand.prototype.executeInternal_ (file:///tmp/tmpmxvBee/extensions/fxdriver@googlecode.com/components/command-processor.js:12666) at DelayedCommand.prototype.execute/< (file:///tmp/tmpmxvBee/extensions/fxdriver@googlecode.com/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?

Saurabh Gaur
  • 23,507
  • 10
  • 54
  • 73
Tales Pádua
  • 1,331
  • 1
  • 16
  • 36
  • 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 Jul 09 '16 at 05:59
  • @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 applet – Tales Pádua Jul 11 '16 at 14:41
  • Could you share your website url?? – Saurabh Gaur Jul 15 '16 at 05:26
  • @SaurabhGaur I cant because its a justice system website that requires a custom certificate to login, so you would't be able to visit it – Tales Pádua Jul 18 '16 at 14:15

1 Answers1

0

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

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

Corey Goldberg
  • 59,062
  • 28
  • 129
  • 143