Selenium multiple tabs at once

前端 未结 7 1420
孤城傲影
孤城傲影 2020-11-27 17:24

I\'m working with Selenium, and am wondering if it\'s possible to use multiple TABS at once? I do not want to use multiple browser instances (i.e., 2 copies of IE pun). IF I

7条回答
  •  有刺的猬
    2020-11-27 17:42

    If there is a link that opens up a new window/tab, then you can use driver.switchTo().window();

    However, if you want to run something on multiple windows, then I recommend having multiple instances of webdriver. It is much easier to manage, and is supported (There are workarounds on opening a new tab/window, such as pressing a hotkey that opens a new window, but they aren't supported).

    If you are wanting to have multiple threads all act on the same driver instance, but different tabs, that is NOT possible.

提交回复
热议问题