我有一个硒网格设置,并且需要从客户端计算机运行网格,并且它在IE中的远程计算机中命中URL。IE在远程计算机中启动。代码在C#中。下面是代码我希望硒以“以管理员身份运行”模式启动IE。有人可以帮我吗?
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);
像硒一样,硒没有提供以其他用户身份启动IE浏览器的选项。
一种解决方法是以管理员身份登录该计算机,然后尝试运行代码。您可以测试一下,看看是否有帮助。
参考: