Multiple Instances of Firefox during Selenium Webdriver Testing not handling focus correctly.

后端 未结 3 1027
春和景丽
春和景丽 2020-12-19 05:21

I have noticed that while running multiple selenium firefox tests in parallel on a grid that the focus event handling is not working correctly. I have confirmed that when ea

3条回答
  •  猫巷女王i
    2020-12-19 06:00

    You can wrangle this and get it under your control with no problem. First write a method to identify the popup window by its window handle id. Then, use a JavaScriptExecutor to execute "window.focus()" in javascript to force the window to be focused just before you perform another action. Then, you can close the popup by its window handle name if necessary.

提交回复
热议问题