Morteza Taghizadeh
Morteza Taghizadeh

Reputation: 2147

How to un-minimize selenium window?

There are tons of guides that show how to minimize browser window opened with Selenium. But I can't find any guide for un-minimize minimized window.

How can I do it?

Upvotes: 0

Views: 485

Answers (1)

Morteza Taghizadeh
Morteza Taghizadeh

Reputation: 2147

The solution is this:

#make this variable before minimize:
handle_of_the_window = driver.current_window_handle
driver.minimize_window()

# your code


# now switch to that window and restore it
driver.switch_to.window(handle_of_the_window)
driver.set_window_rect(0, 0)

Upvotes: 2

Related Questions