问题
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);
回答1:
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:
Selenium Grid
Running IE as a different user with Selenium Webdriver in Java
IE Webdriver do not support run as other user
来源:https://stackoverflow.com/questions/61797419/selenium-grid-launching-remote-ie-browser-as-run-as-administrator