Java Selenium:SafariDriver未在MacOSX Sierra开业
我有最新的Selenium、OSX和Safari版本,但我无法使用如此简单的代码打开Safari驱动程序:Java Selenium:SafariDriver未在MacOSX Sierra开业,java,selenium,testing,automation,safaridriver,Java,Selenium,Testing,Automation,Safaridriver,我有最新的Selenium、OSX和Safari版本,但我无法使用如此简单的代码打开Safari驱动程序: import org.openqa.selenium.WebDriver; import org.openqa.selenium.safari.SafariDriver; public class SafariDriverDemo { public static void main(String[] args) throws InterruptedException {
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.safari.SafariDriver;
public class SafariDriverDemo {
public static void main(String[] args) throws InterruptedException {
WebDriver driver;
driver = new SafariDriver();
String baseURL = "https://www.google.com";
driver.get(baseURL);
Thread.sleep(3000);
driver.quit();
}
}
我在控制台中得到的信息如下:密码:密码:密码:
无论我写什么密码,控制台都会显示:
尽管我启用了“允许远程自动化”,但仍然存在此问题。我试图通过键入“/usr/bin/safaridriver”从终端授权驱动程序,结果就是这样
Could not start server: must specify at least one configuration argument.
Usage: safaridriver [options]
-h, --help Prints out this usage information.
-p, --port Port number the driver should use. If the server
is already running, the port cannot be changed.
If port 0 is specified, a default port will be used
我不知道从这里可以采取什么措施,也许可以从控制台解决问题。尝试运行/usr/bin/safaridriver-p 0请提及实际版本号。自2017年5月4日以来,最近一次发生了变化。你的问题的答案也可能不同。