0 points

python - Check if the active tab is the correct - Stack Overflow


dashboard

Sun Sep 27 2020 17:12:19 GMT+0000 (UTC)

Posted by @guido #python

desired_tab = driver.current_window_handle  #storing the handle in a variable
if driver.current_window_handle != desired_tab:
   driver.switch_to_window(desired_tab)  #switching to the tab in case it's not
content_copy Copy

https://stackoverflow.com/questions/51924128/check-if-the-active-tab-is-the-correct