0

I have a selenium grid setup and from client machine need to run the grid and it is hitting an URL in remote machine in IE.IE is getting launched in remote machine.The code is in C#. below is the code I want selenium to launch IE as "Run as Administrator" mode. Can some one help me with this ?

InternetExplorerOptions options = new InternetExplorerOptions();                        options.IntroduceInstabilityByIgnoringProtectedModeSettings = true;
options.EnableNativeEvents = true;
options.ForceShellWindowsApi = true;
driver = new RemoteWebDriver(new Uri("http://10.x.x.10/wd/hub"), DesiredCapabilities.InternetExplorer());
driver = new RemoteWebDriver(new Uri("http://" + remoteIP + ":" + port + "/wd/hub"), DesiredCapabilities.InternetExplorer());
driver.Manage().Window.Maximize();
driver.Navigate().GoToUrl(applicationurl);

Zoso619
  • 163
  • 1
  • 3
  • 15

1 Answers1

0

Looks like selenium does not provide an option to launch the IE browser as a different user.

One workaround can be to log on that machine as an administrator and then try to run the code. You can test and see whether it helps or not.

References:

  1. Selenium Grid

  2. Running IE as a different user with Selenium Webdriver in Java

  3. IE Webdriver do not support run as other user

Deepak-MSFT
  • 10,379
  • 1
  • 12
  • 19
  • Is there nay possibility with different browser like chrome ? can we run chrome as administrator in selenium grid? – Zoso619 May 15 '20 at 08:04
  • Selenium provides similar kinds of features and functionality for the list of major browsers. It looks like Selenium does not provide a way to launch any browser as an administrator. – Deepak-MSFT May 19 '20 at 07:26