0

I have a written a program that will open windows in chrome, iterate through them to find a specific one and close that window if found.

I used a Mac OS python import and am having trouble converting this line:

for item in app('Web Chrome').window[0].tabs():

into a windows friendly version using webdriver. Any ideas?

2

1 Answer 1

1

Did you try with window_handle function?

for handle in driver.window_handles:
    driver.switch_to_window(handle)
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.