我有最新的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 {
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我不知道从这里采取什么行动,也许这个问题可以从控制台解决。
发布于 2017-05-15 18:27:23
尝试运行/usr/bin/safaridriver -p 0
https://stackoverflow.com/questions/43780709
复制相似问题