Skip to content

A simple environment with which you can run browser automation tasks with Selenium Webdriver using Node.js as well as a collection of examples to get you started.

License

Notifications You must be signed in to change notification settings

TorlockC/simple-selenium-node.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Selenium Node.js

This repository consists of a simple Node.js environment for running browser automation tasks/tests using the Selenium WebDriver. The aim is provide a quick solution to get you up and running along with a collection of functions that perform common tasks which you can implement and/or alter as per your own requirements.

In order to run the project you first need to:

  • Install Node.js
  • Install GeckoDriver1
  • Navigate to simple-selenium-node.js-master directory
  • Run npm install to fetch dependencies (i.e. selenium-webdriver)

To test a particular function:

  • Navigate to simple-selenium-node.js-master/examples directory
  • Run node chosenFunction.js (replacing chosenFunction.js with the script you actually want to run)

Example functions include:

  • googleSearch.js - opens Google and searchs for the term "askew"
  • screenshotElement.js - opens Google weather, screenshots the forecast element and saves it to disk
  • screenshotPage.js - opens Unsplash, screenshots the entire visible page and saves it to disk
  • outputText.js - opens Bacon Ipsum, getText() by class name and log the result to console

1This project primarily focuses on FireFox. For Chrome, Safari, IE etc. the relevant alternatives to GeckoDriver will need to be installed and some small edits to the scripts need to be made. I plan on incorporating additional browsers shortly.

About

A simple environment with which you can run browser automation tasks with Selenium Webdriver using Node.js as well as a collection of examples to get you started.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published