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/[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?

4
  • 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... Commented Jul 9, 2016 at 5: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 Commented Jul 11, 2016 at 14:41
  • Could you share your website url?? Commented Jul 15, 2016 at 5: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 Commented Jul 18, 2016 at 14:15

1 Answer 1

0

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

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.