eclipse Selenium WebDriver 是否支持 Safari?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9884840/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Does Selenium WebDriver support Safari?
提问by ABCDEFG
I'm using Selenium WebDriver with Java. I want to use Safari browser. Does Selenium WebDriver
support Safari
?
我在 Java 中使用 Selenium WebDriver。我想使用 Safari 浏览器。是否Selenium WebDriver
支持Safari
?
采纳答案by kenki
The SafariDriver is still experimental and relies on a browser plugin using WebSockets to communicate to the browser. It's a great step and it's something that many have been waiting for.
SafariDriver 仍处于试验阶段,它依赖于使用 WebSockets 的浏览器插件与浏览器进行通信。这是重要的一步,也是许多人一直在等待的事情。
However, if you want something a bit more stable, Darrel Grainger has a good poston how to instantiate a Webdriver object utilizing the Selenium RC (a.k.a Selenium 1) API.
但是,如果您想要更稳定的东西,Darrel Grainger 有一篇关于如何使用 Selenium RC(又名 Selenium 1)API 实例化 Webdriver 对象的好文章。
It's probably the best way to get Safari testing going right now.
这可能是现在进行 Safari 测试的最佳方式。
Refer latest post here by Apple: https://developer.apple.com/documentation/webkit/testing_with_webdriver_in_safari
请参阅 Apple 的最新帖子:https: //developer.apple.com/documentation/webkit/testing_with_webdriver_in_safari
回答by p0deje
Experimental support of Safari was added in Selenium recently. See https://code.google.com/p/selenium/wiki/SafariDriver
最近在 Selenium 中添加了对 Safari 的实验性支持。请参阅https://code.google.com/p/selenium/wiki/SafariDriver
回答by Thiyagarajan Veluchamy
Yes, webdriver will support Safari. following instruction https://code.google.com/p/selenium/wiki/SafariDriver
是的,webdriver 将支持 Safari。按照说明https://code.google.com/p/selenium/wiki/SafariDriver
回答by finspin
As of Safari 10, there is now a native support for WebDriver API. More info here https://webkit.org/blog/6900/webdriver-support-in-safari-10/
从 Safari 10 开始,现在有对 WebDriver API 的本机支持。更多信息在这里https://webkit.org/blog/6900/webdriver-support-in-safari-10/
回答by Vikrant Kumar
Short and precise answer is YES.
简短而准确的答案是肯定的。
Selenium 3 supports Safari 12 in a well mannered way. It's pretty much stable for automation testing.
Selenium 3 以一种很好的方式支持 Safari 12。它对于自动化测试非常稳定。
I am using Selenium v3.141.59with Safari v12.1.2flawlessly.
我完美地将Selenium v3.141.59与Safari v12.1.2一起使用。
With Selenium 3, you don't need to download/install SafariDriver explicitly; instead you just need to enable the built in SafariDrivercomes with MacOS.
使用 Selenium 3,您无需明确下载/安装 SafariDriver;相反,您只需要启用MacOS 自带的内置 SafariDriver。
回答by Ripon Al Wasim
You can see the Selenium Java API doc:
您可以查看 Selenium Java API 文档:
http://selenium.googlecode.com/svn/trunk/docs/api/java/index.html
http://selenium.googlecode.com/svn/trunk/docs/api/java/index.html
There are detail of Class SafariDriver
Class SafariDriver 有详细介绍
回答by Erik
All these answers were out of date for me. I had to track down and find the latest ... it's located here :
所有这些答案对我来说都过时了。我不得不追查并找到最新的......它位于这里:
http://elementalselenium.com/tips/69-safari
http://elementalselenium.com/tips/69-safari
Download for the driver is
下载驱动程序是
回答by Ajay
Yes it does support Safari but, it is not much stable as of now!
是的,它确实支持 Safari,但目前还不是很稳定!
回答by Ripon Al Wasim
Prerequisite: Install Safari on Windows
先决条件:在 Windows 上安装 Safari
- Go to http://docs.seleniumhq.org/download/
- Scroll down -> Go to the section "SafariDriver" and download "SafariDriver.safariextz"
- Double click on "SafariDriver.safariextz" (previously downloaded)
- Safari would open with a pop up containing "Install" button -> Click Install button
- Now go to Preferences of Safari and you would see WebDriver (in my case WebDriver 2.48.0) is installed (Enable WebDriver checkbox is checked))
Write the WebDriver Java code as below:
WebDriver driver = new SafariDriver();
driver.get("https://www.packtpub.com/web-development/mastering-selenium-testing-tools-video");
- 转到http://docs.seleniumhq.org/download/
- 向下滚动 -> 转到“SafariDriver”部分并下载“SafariDriver.safariextz”
- 双击“SafariDriver.safariextz”(之前下载的)
- Safari 将打开一个包含“安装”按钮的弹出窗口 -> 单击“安装”按钮
- 现在转到 Safari 的首选项,您会看到安装了 WebDriver(在我的情况下为 WebDriver 2.48.0)(选中启用 WebDriver 复选框))
编写 WebDriver Java 代码如下:
WebDriver 驱动程序 = 新的 SafariDriver();
driver.get(" https://www.packtpub.com/web-development/mastering-selenium-testing-tools-video");
回答by Raghubansh
Web driver does support safari with the help of crome driver.
Web 驱动程序在 crome 驱动程序的帮助下确实支持 safari。
please see this
请看这个
http://seleniumhq.org/docs/03_webdriver.html#selenium-webdriver-s-drivers
http://seleniumhq.org/docs/03_webdriver.html#selenium-webdriver-s-drivers