C# 如何在服务器上传递驱动程序路径?
找不到驱动程序错误? 我正在使用ASP.NET,C#。任何帮助C# 如何在服务器上传递驱动程序路径?,c#,asp.net,selenium,C#,Asp.net,Selenium,找不到驱动程序错误? 我正在使用ASP.NET,C#。任何帮助 谢谢,您可以尝试以下内容:- IWebDriver driver1 = new InternetExplorerDriver(" '+ Server.MapPath("~\\IEDriverServer_Win32_2.25.2\\IEDriverServer.exe") +' "); 您必须包括Microsoft.VisualStudio.TestTools.UnitTesting和 private const string
谢谢,您可以尝试以下内容:-
IWebDriver driver1 = new InternetExplorerDriver(" '+ Server.MapPath("~\\IEDriverServer_Win32_2.25.2\\IEDriverServer.exe") +' ");
您必须包括Microsoft.VisualStudio.TestTools.UnitTesting
和
private const string URL = "http://url";
private const string IE_DRIVER_PATH = @"C:\PathTo\IEDriverServer";
[TestMethod]
public void Test()
{
var options = new InternetExplorerOptions()
{
InitialBrowserUrl = URL,
IntroduceInstabilityByIgnoringProtectedModeSettings = true
};
var driver = new InternetExplorerDriver(IE_DRIVER_PATH, options);
driver.Navigate();
driver.Close();
driver.Quit();
}
我在服务器上获得了exe文件,如何获取服务器位置并将其作为字符串传递给驱动程序?
OpenQA.Selenium.IE namespace