Automation testing for Edge Legacy in C#

518 Views Asked by At

I want to run automation testing on Edge Legacy (not Chromium) but need the option to also change the browsers settings in the process, specifically the Theme and the Cookies settings. I tried using Winium.Cruciatus but was unable to even run the browser's executable. Is there a different library that allows these kinds of actions for automation testing?

Thanks!

1

There are 1 best solutions below

2
Deepak-MSFT On

I suggest trying to use Microsoft WebDriver to automate the MS Edge legacy browser.

It is a suitable solution for automation.

If you are using the builds prior to 18 then you can refer to the link below to download the appropriate version of a web driver.

Download WebDriver for MS Edge browser

Microsoft WebDriver for Microsoft Edge version 18 is a Windows Feature on Demand.

To install run the following in an elevated command prompt:

DISM.exe /Online /Add-Capability /CapabilityName:Microsoft.WebDriver~~~~0.0.1.0

Web driver will get installed on the location below.

C:\Windows\System32\MicrosoftWebDriver.exe

You also need to download the necessary NuGet packages in your C# project.

Here is a sample code to launch the MS Edge legacy browser.

System.setProperty("webdriver.edge.driver", "C:\\Windows\\System32\\MicrosoftWebDriver.exe");
WebDriver driver = new OpenQA.Selenium.Edge.EdgeDriver();
driver.get("https://example.com");

You said that you need the options to change the browser settings in the process, specifically the Theme and the Cookies settings.

You will not able to modify most of the browser settings using selenium automation. Few browser settings are available to modify using automation. You can use Selenium automation to fully automate the webpages.