【发布时间】:2021-05-20 03:49:03
【问题描述】:
在下面的代码中,IEDriverServer.exe 在我的本地机器上可用。我想在不同的机器上运行这段代码。 C#获取IEDriverServer.exe时如何设置相对路径。
InternetExplorerOptions options = new InternetExplorerOptions()
{
ForceCreateProcessApi = true,
BrowserCommandLineArguments = "-private",
IntroduceInstabilityByIgnoringProtectedModeSettings = true,
IgnoreZoomLevel = true
};
IWebDriver driver = new InternetExplorerDriver(Path.GetFullPath("C:\\Users\\kamal\\Documents\\Sample\\Sample\\bin\\Debug"), options);
driver.Navigate().GoToUrl("https://www.google.com");
driver.Quit();
【问题讨论】:
标签: c# selenium-webdriver internet-explorer path relative-path