Does Selenium WebDriver support Safari?

后端 未结 11 1122
醉话见心
醉话见心 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: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");

提交回复
热议问题