Selenium + Node
Introduction to Selenium Webdriver Introduction to Node.js Installation and Environment set up NPM – Package Manage for Node.js Directory layout of Selenium Webdriver Node.js package Chrome Chrome with options Chrome in Mobile Emulation IE Firefox Element identification methodsAssertions in Selenium in Node.js Interacting with elements in Selenium in Node.js Basic Browser window automation Sending keys in Selenium in Node.js Synchronization in Selenium Check if Element exists Working with Tables using Selenium Performing advanced actions using Selenium in Node.js Executing JavaScript in Selenium in Node.js Working with multiple Browser Windows or tabs Working with multiple frames Handling alerts Common exceptions in Selenium Taking a screenshot in selenium Mocha – Unit testing framework Selenium gridSelenium grid in node
You can also use standalone server to run your tests. Just start the server using below command.
java -jar selenium-server-standalone.jar
By default server (Hub) starts running at https://localhost:4444/wd/hub
//To connect to Grid, you will have to use below syntax.
var assert = require(‘assert’);
var webdriver = require(‘selenium-webdriver’),
By = webdriver.By,
until = webdriver.until;
var chrome = require(“selenium-webdriver/chrome”);
var driver = new webdriver.Builder()
.forBrowser(‘chrome’)
.usingServer(‘https://localhost:4444/wd/hub’)
.build();
driver.get(“https://www.softpost.org”);
driver.quit();
You can use below command to run tests on grid.
//SELENIUM_REMOTE_URL=”https://localhost:4444/wd/hub” node yourscript.js
Web development and Automation testing
solutions delivered!!