Note: the solution in Selenium or the Splinter API wrapper for Selenium is great!
I'm having trouble interacting with iframes on Twitter.com using the Splinter API for Python.
For instance,
with Browser('firefox', profile_preferences= proxySettings) as browser: #...login and do other stuff here browser.find_by_id('global-new-tweet-button').click()
a pop-up window appears for entering a tweet.
How can I interact with this new field using Splinter for: 1) fill out a message 2) click "tweet" (send) .. programmatically, of course.
I tried to check the element, but it does not seem to be nested inside the iframe, however it is aimed at the iframe. So I'm not sure how to find / interact with the elements of this popup.
I tried manually typing a message, and then programmatically pressing the tweet button:
browser.find_by_css('.btn.primary-btn.tweet-action.tweet-btn.js-tweet-btn').click()
.. but I get the error:
ElementNotVisibleException: Message: Element is not currently visible and so may not be interacted with Stacktrace: at fxdriver.preconditions.visible (file:///var/folders/z1/8rqrglqn2dj8_yj1z2fv5j700000gn/T/tmppRsJvd/extensions/ fxdriver@googlecode.com /components/command-processor.js:10092) at DelayedCommand.prototype.checkPreconditions_ (file:///var/folders/z1/8rqrglqn2dj8_yj1z2fv5j700000gn/T/tmppRsJvd/extensions/ fxdriver@googlecode.com /components/command-processor.js:12644) at DelayedCommand.prototype.executeInternal_/h (file:///var/folders/z1/8rqrglqn2dj8_yj1z2fv5j700000gn/T/tmppRsJvd/extensions/ fxdriver@googlecode.com /components/command-processor.js:12661) at DelayedCommand.prototype.executeInternal_ (file:///var/folders/z1/8rqrglqn2dj8_yj1z2fv5j700000gn/T/tmppRsJvd/extensions/ fxdriver@googlecode.com /components/command-processor.js:12666) at DelayedCommand.prototype.execute/< (file:///var/folders/z1/8rqrglqn2dj8_yj1z2fv5j700000gn/T/tmppRsJvd/extensions/ fxdriver@googlecode.com /components/command-processor.js:12608)
I strictly want to achieve my goal using Splinter, so please do not offer alternatives, I know that there are other ways. Thank you in advance!
source share