Does Selenium WebDriver support Safari?

后端 未结 11 1066
醉话见心
醉话见心 2020-12-29 13:33

I\'m using Selenium WebDriver with Java. I want to use Safari browser. Does Selenium WebDriver support Safari?

相关标签:
11条回答
  • 2020-12-29 14:01

    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.

    However, if you want something a bit more stable, Darrel Grainger has a good post on how to instantiate a Webdriver object utilizing the Selenium RC (a.k.a Selenium 1) API.

    It's probably the best way to get Safari testing going right now.

    Refer latest post here by Apple: https://developer.apple.com/documentation/webkit/testing_with_webdriver_in_safari

    0 讨论(0)
  • 2020-12-29 14:01

    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

    Download for the driver is

    http://docs.seleniumhq.org/download/

    0 讨论(0)
  • 2020-12-29 14:02

    Short and precise answer is YES.

    Selenium 3 supports Safari 12 in a well mannered way. It's pretty much stable for automation testing.

    I am using Selenium v3.141.59 with Safari v12.1.2 flawlessly.

    With Selenium 3, you don't need to download/install SafariDriver explicitly; instead you just need to enable the built in SafariDriver comes with MacOS.

    0 讨论(0)
  • 2020-12-29 14:09

    Yes it does support Safari but, it is not much stable as of now!

    0 讨论(0)
  • 2020-12-29 14:11

    Web driver does support safari with the help of crome driver.

    please see this

    http://seleniumhq.org/docs/03_webdriver.html#selenium-webdriver-s-drivers

    0 讨论(0)
  • 2020-12-29 14:12

    Prerequisite: Install Safari on Windows

    1. Go to http://docs.seleniumhq.org/download/
    2. Scroll down -> Go to the section "SafariDriver" and download "SafariDriver.safariextz"
    3. Double click on "SafariDriver.safariextz" (previously downloaded)
    4. Safari would open with a pop up containing "Install" button -> Click Install button
    5. 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))
    6. Write the WebDriver Java code as below:

      WebDriver driver = new SafariDriver();
      driver.get("https://www.packtpub.com/web-development/mastering-selenium-testing-tools-video");

    0 讨论(0)
提交回复
热议问题