Showing posts with label Safari. Show all posts
Showing posts with label Safari. Show all posts

June 30, 2015

Run WebDriver script in Safari Browser

June 30, 2015 1
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.