Selenium – change windows

23 Aug

Upgraded capybara to 2.1.x (with Selenium Webdriver) and my switch_to window calls started failing.

This is how i fixed it:

within_window(page.driver.browser.window_handles.last) do
   page.should have_content('My Text on New PopUP')

Seems to take a lot of trial and error when these things break.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: