June 30, 2015

Run WebDriver script in Safari Browser

If you want to run WebDriver script in Safari. Manually we need to install the SafariDriver browser extension.

Prerequisites:

Safari 5.1+
SafariDriver browser extension.

you can download SafariDriver browser extension from below sites:

http://selenium-release.storage.googleapis.com/index.html?path=2.45/

or

There is safari driver section in selenium site.
http://docs.seleniumhq.org/download/  ---go to Safari Driver section and download the latest version of SafariDriver browser extension.

Once you download safari browser extension it will be in this format "SafariDriver.safariextz"

Double click that file or open with Safari browser. It will ask you for Installation confirmation, click Install and once installation is done you can see Webdriver Extension. Safari--Edit--Preferences.




If you see this extension then you should be able to run script in safari browser.

Once installed, writing a test for Safari is just as straightforward as using the FirefoxDriver

Below is the sample code of to run script using safari browser.





1 comment:

  1. Your post about Selenium scripts is really interesting. Also I want to know the latest new techniques which are implemented in selenium. Can you please update it in your website? Selenium training in Chennai | Selenium Training

    ReplyDelete