Enterprise applications have long end-to-end scenarios where we need to pass the result of a few steps to the next scenario while execution continues in another window.
So, we have to handle multiple windows as per the requirement of the test case/script. During execution, we need to go back to the previous window or move to the next window.
Selenium webdriver provides modules that can use methods to access the previous or next window.
Save handle i.e 1st_window= driver.window_handles
If you want to switch to another window driver.switch_to_window(driver.window_handles);
If you want to Switch to 1st window then execute driver.switch_to.window(1st_window)
To close the window execute driver.close()
Post a Comment