How to open incognito/private window with Selenium WD for different browser types?

后端 未结 9 914
感情败类
感情败类 2020-12-05 08:18

I want to test my test cases in private window or incognito window.

How to do the same in various browsers:

9条回答
  •  无人及你
    2020-12-05 09:05

    FirefoxOptions opts = new FirefoxOptions();
    opts.addArguments("-private");
    FirefoxDrive f = new FirefoxDriver(opts);
    

    This works fine for selenium version 3.14.0 and geckodriver-v0.22.0

提交回复
热议问题