I’m facing below error when trying to switch windows in python selenium webdriver.
found more than 1 handles...
INFO: ['4294967297', '4294967308']
ERROR: Exception: NoSuchWindowException, Message: Unable to locate window: undefined
ERROR: Stacktrace:
ERROR: WebDriverError@chrome://marionette/content/error.js:175:5
This the code snippet, I have posted the code that is after clicking that opens the new window.
handles = base_params[self.driver_key].window_handles
if len(handles) > 1:
logger.info(len(handles))
logger.info("found more than 1 handles...")
logger.info(handles)
base_params[self.driver_key].switch_to.window(handles[1])
print("Switched to popup window with title:", base_params[self.driver_key].title)
else:
print("No popup window found")
Not sure what I’m missing here. I also posted the execute logs above.
I’m expecting the window to be switched.