【发布时间】:2017-05-04 10:45:51
【问题描述】:
我有最新的 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();
}
}
- 我在控制台中得到以下内容:“Password:Password:Password:”
- 无论我写什么密码,控制台都会显示:Screenshot 2
尽管我启用了“允许远程自动化”。我尝试通过键入“/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 年 5 月 4 日以来,“最新”已更改。您的问题的答案也可能有所不同。
标签: java selenium testing automation safaridriver