Marcus
Marcus

Reputation: 29

Selenium WebDriver Python: Unable to switch to pop up

I am working on an application that works only in IE and has ActiveX Grid. When I click on a grid cell, a 'pop up' opens and the popup has title like this: <title of the window>--Webpage Dialog.

window_handles gives me only one handle before(that of the parent window) and after opening the pop up. Parent window becomes unclickable until the popup is closed. When I open the developer tools on the IE window after opening the pop up, it shows me the pop up contents. It has one iframe and the edit boxes that I am supposed to work on.

All of my attempts to reach the edit boxes inside the iframe of the popup have not worked.

i tried-

driver.switch to default content()

driver.switchtoiframe(popup)

Error:

NoSuchFrameException

alert=driver.switchtoalert()## Doesn't throw any errors but I am lost on how to reach the edit boxes.

Upvotes: 1

Views: 1461

Answers (1)

Saifur
Saifur

Reputation: 16201

If you use the latest Selenium Python binding then use driver.switch_to.frame Notice the . after switch_to. switch_to_frame() is deprecated in latest version. See the doc

Upvotes: 1

Related Questions