microsoft / EasyRepro

Automated UI testing API for Dynamics 365
MIT License
513 stars 285 forks source link

Unable to run edge browser in private mode #1366

Open bkrishnamurthylqgroup opened 1 year ago

bkrishnamurthylqgroup commented 1 year ago

I am trying to run the automation scripts using edge browser in private window but it always running in normal mode. I have set the below in my app.config file,

<add key="BrowserType" value="Edge" />
<add key="DriversPath" value="" />
<add key="UsePrivateMode" value="true" />

My BrowserOption.cs contains the below,

public virtual EdgeOptions ToEdge() { var options = new EdgeOptions() { PageLoadStrategy = PageLoadStrategy.Normal, UseInPrivateBrowsing = PrivateMode };

        return options;
    }

My Test settings file contains as below,

        BrowserType = (BrowserType)Enum.Parse(typeof(BrowserType), Type),
        PrivateMode = true,
        FireEvents = false,
        Headless = false,
        Width = 1920,
        Height=1080,
        UserAgent = false,
        DefaultThinkTime = 2000,
        RemoteBrowserType = (BrowserType)Enum.Parse(typeof(BrowserType), RemoteType),
        RemoteHubServer = new Uri(RemoteHubServerURL),
        UCITestMode = true,
        UCIPerformanceMode = false,
        //DriversPath = Path.IsPathRooted(DriversPath) ? DriversPath : Path.Combine(Directory.GetCurrentDirectory(), DriversPath), 
        DisableExtensions = false,
        DisableFeatures = false,
        DisablePopupBlocking = false,
        DisableSettingsWindow = false,
        EnableJavascript = false,
        NoSandbox = false,
        DisableGpu = false,
        DumpDom = false,
        EnableAutomation = true,
        DisableImplSidePainting = false,
        DisableDevShmUsage = false,
        DisableInfoBars = false,
        TestTypeBrowser = false,
        DriversPath = GetDriverPath()

Machine: Windows 10 Enterprise, 64 bit Edge driver version: 110.0.1587.50

I am struggling in this as logged in credentails taken by default instead of the defined credentials when i run the scripts in normal mode. It would be great if someone suggest how to run the edge browser in private mode?