Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

How to Force Selenic to Run Edge in inPrivate Window

Speedy993
Speedy993 Posts: 72

I have a large number of Selenic tests that run in the Edge browser. I now require them to run in an Edge inPrivate windows. Is there some configuration I can do to the driver before opening the browser?

Thanks!

Best Answer

Answers

  • benken_parasoft
    benken_parasoft Posts: 1,306 ✭✭✭
    edited November 20

    This worked for me:

    EdgeOptions options = new EdgeOptions();
    options.addArguments("inprivate");
    driver = new EdgeDriver(options);
    

    I see "InPrivate" labels shown in the browser's title bar and tool bar.

  • Speedy993
    Speedy993 Posts: 72

    Thanks for the answer benkin-parasoft. Unfortunately, I am getting and error that states 'The method addArguements(String) is undefined for the type EdgeOptions'. I have imports for org.openqa.selenium.edge.EdgeDriver and org.openqa.selenium.edge.EdgeOptions. Am I missing another one or perhaps I have an incorrect one? Thanks!

  • benken_parasoft
    benken_parasoft Posts: 1,306 ✭✭✭

    addArguements

    Try "addArguments".

  • Speedy993
    Speedy993 Posts: 72

    Sorry, my typing skills are not very good. I actually did have addArguments. When I use CTRL+ space for the hints for EdgeOptions, addArguments does not appear but setCapability does. I have seen when googling this question that some of the older posts use setCapability. So I have this but it does not seem to work.
    EdgeOptions options = new EdgeOptions();
    options.setCapability("inprivate", true);
    // options.setCapability("-inprivate",true);
    // options.addArguments("inprivate");
    driver = new EdgeDriver(options);
    I am using an older version of Selenic (2021.1.2) and plan to update to the latest versions of Selenic and SOATest soon. This is being developed and tested in IBM's Rational Application Developer (RAD) 9.7.0.4.
    I confirmed that the Edge webdriver is the latest one and matches the version of Edge I am running.

  • Speedy993
    Speedy993 Posts: 72

    Thanks!