0

When I click a button open new window How do I know window open finished?

In wait frame can I use below

wait.until(EC.frame_to_be_available_and_switch_to_it(driver.find_element_by_name('newframe')))

in new window?

1 Answer 1

1

You can find the count of the current(before) window handles and get after windows handles and implement lambda to wait for them NOT to be equal. I am not familiar with such/similar build in Selenium mechanism.

def wait_for_new_window(driver, timeout=10):
        handles_before = driver.window_handles
        yield
        WebDriverWait(driver, timeout).until(
            lambda driver: len(handles_before) != len(driver.window_handles))

See this answer on similar topic.

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.