Saturday, 9 May 2015

WebdriverJS - JavaScript bindings for WebDriver

WebdriverJS is javascript bindings for webdriver, using WebdriverJS you can write the automation script in javascript and execute the Webdriver Javascript.

Prerequisite:
1. Node.js is alreaddy installed click 'http://automation-home.blogspot.in/2015/05/installing-nodejs-and-npm-on-windows.html' for node.js installation process.
2. 'Chromedriver.exe' can be downloaded from 'https://sites.google.com/a/chromium.org/chromedriver/downloads'
3. Set the 'Chromedriver.exe' in the PATH variable,
click the url 'http://www.computerhope.com/issues/ch000549.htm' for setting the PATH variable.

Steps for Executing the script developed using WebdriverJS:

Open the url 'https://code.google.com/p/selenium/wiki/WebDriverJs'

Save the copied javascript as 'SampleTest.js'.

Open the command prompt, navigate to the location where 'SampleTest.js' is present.
Run the command 'npm install selenium-webdriver' in the command prompt.

Run the command 'node SampleTest.js' in the command prompt.

Javascript 'SampleTest.js' is executed.

Watch Demo
Note:
Above post is older.
Webdriverjs is now deprecated,
Project is now called WebdriverIO(http://webdriver.io/). 

No comments:

Post a Comment