[英]How to use SafariDriver with Selenium WebDriver
I am testing on Selenium WebDriver on SafariDriver.我正在 SafariDriver 上测试 Selenium WebDriver。
I obtain this message in the beginning:我一开始就收到了这条消息:
SafariDriver Launcher
[ 0.024s] [safaridriver.client] Connecting to SafariDriver browser extension...
[ 0.033s] [safaridriver.client] This will fail if you have not installed the latest SafariDriver extension from
http://selenium-release.storage.googleapis.com/index.html
[ 0.033s] [safaridriver.client] Extension logs may be viewed by clicking the Selenium [✓] button on the Safari toolbar
[ 0.082s] [safaridriver.client] Connected to extension
[ 0.083s] [safaridriver.client] Requesting extension connect to client at ws://localhost:36850
And after I obtain this message error:在我收到此消息错误后:
Proxy Error
The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request POST /tunnel/cart/add/uenc/aHR0cDovL2dlbmVyb3NpdHktZGVtby5iaXNub2RlLmZyOjgyL2NhbXBhZ25lLWRlLWRvbi10cmVlLWxhYi5odG1s/product/23/form_key/JEQ8UWdbycz65baM/.
Reason: Error reading from remote server
For launching Safari I use:为了启动 Safari,我使用:
Webdriver driver = new SafariDriver()
How can I resolve this problem?我该如何解决这个问题?
You need to download the safaridriver.safaridriverxtz from the provided link and then double click it (click trust) and enable it as an extension for your Safari.您需要从提供的链接下载 safaridriver.safaridriverxtz,然后双击它(单击信任)并将其启用为 Safari 的扩展。
Restart and it should work (although I am running into other issues with it here...).重新启动它应该可以工作(尽管我在这里遇到了其他问题......)。
Configure and enable Safari WebDriver:配置并启用 Safari WebDriver:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.