-
Change Request
-
Resolution: Unresolved
-
Low
-
None
-
7.0.4
-
None
Hi Zabbix team,
For enhanced web monitoring capabilities, we propose implementing a feature that allows switching to a new browser window. This is particularly useful for scenarios where a new window opens after clicking a button or hyperlink.
The implementation can be achieved using Selenium WebDriver. Below is the code snippet that handles the switching to a new browser window:
# Wait for the new window or tab
wait.until(EC.number_of_windows_to_be(2))
# Loop through until we find a new window handle
for window_handle in driver.window_handles:
if window_handle != original_window:
driver.switch_to.window(window_handle)
break
# Wait for the new tab to finish loading content
wait.until(EC.title_is("SeleniumHQ Browser Automation"))
Source: https://www.selenium.dev/documentation/webdriver/interactions/windows/