Selenium multiple tabs at once

前端 未结 7 1422
孤城傲影
孤城傲影 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:49

    if you are wishing to run the multıple wındows at the same time, use threading with multiple instances of IWebDriver

    EX:

    public void Work()
    {
    IWebDriver driver = new ChromeDriver("D:\\Drivers");
    driver.Navigate().GoToUrl(URL);
    \\Do the rest
    }
    public void Work2()
    {
    IWebDriver driver = new ChromeDriver("D:\\Drivers");
    driver.Navigate().GoToUrl(URL2);
    \\Do the rest
    }
    

    and call the function like this:

    Thread thread1 = new Thread(new ThreadStart(Work));
    thread1.Start();
    Thread thread2 = new Thread(new ThreadStart(Work2));
    thread2.Start();
    
    0 讨论(0)
提交回复
热议问题