如何判断您使用的是哪个版本的Edge web驱动程序?
我想使用网络驱动程序微软边缘44.18362.449.0,微软EdgeHTML 18.18363
按照这里的指示,我这样做是为了获得Webdriver
“在提升的命令提示符下运行以下命令,通过DISM安装: DISM.exe /Online /Add-Capability /CapabilityName:Microsoft.WebDriver0.0.1.0”
我在java中使用selenium,我使用chrome浏览器selenium进行测试,我使用.exe文件访问web驱动程序,但是没有提供.exe文件,或者我不知道它安装在哪里。当我运行上面的命令时,我查看了我所在的目录,但没有找到可执行文件。
请建议我如何使用java和selenium连接到web驱动程序。
发布于 2020-04-30 09:24:55
您应该可以找到如下截图所示的MicrosoftWebDriver.exe' atC:\Windows\System32\MicrosoftWebDriver.exe`。

发布于 2020-04-30 13:58:42
是的,我同意@supputuri给出的建议。
您也可以在如下代码中直接引用路径。它也会起作用。
示例:
package selenium_test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.edge.*;
import org.openqa.selenium.WebElement;
public class new_java_class
{
public static void main(String[] args)
{
System.setProperty("webdriver.edge.driver","C:\\\\Windows\\\\System32\\\\MicrosoftWebDriver.exe");
WebDriver browser = new EdgeDriver();
browser.get("https://microsoft.com");
}
}https://stackoverflow.com/questions/61513574
复制相似问题