
Security News
MCP Community Begins Work on Official MCP Metaregistry
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
web-driver-io-tutorial
Advanced tools
This is the README for the Web Driver IO Tutorial.
Please see my blog for a complete description of the files and much more information located at:
The live working test site for the tutorial is located at:
This project was updated to support version 4 of webdriverio
I recently had an interesting challenge presented to me. I needed to introduce automated testing to a Q/A department with very little technical experience and no programming experience.
This was really two (2) separate challenges. The first was to find the technologies to use to do the automated testing. The second was actually training the Q/A department.
The project will only address the technologies used and what I learned in the process.
The technologies worked well but I really had to search for information and spent many hours figuring out issues. There doesn't seem to be much on the Internet about this. I wanted to share this information, so I wrote this project along with a web site page to test all the scripts against.
I hope you find this project useful. If you do, please let me know.
Use Technologies That:
List of technologies I choose:
(Not really webdriverio related but very good information)
Filename | Description |
---|---|
tutorial1.js | Title Test - Open page and verify title |
tutorial1-wdio.js - Title Test - Open page and verify title using WDIO | |
linkTextURL1.js | Link Text/URL Test - Verify Link Text and URL |
copyright1.js | Copyright Test - Verify Copyright Text |
copyright1-wdio.js | Copyright Test - Verify Copyright Text using WDIO |
formFillSubmit1.js | Populate Form Fields and Submit |
showHideVerify1.js | Click Show/Hide Button and Verify Text |
dynamicBrowser.js | Dynamically Invoke Different Browsers |
callbackPromise.js | Compares callbacks VS promises |
debugExample1.js | Example Shows Several Methods on How to Debug |
formFieldValidation.js | Example of Validating Form Field Errors With Both Local Commands and Reusable Commands (commonLib.js) |
common/commonLib.js | Example of Reusable Functions (library) |
dataLoopExample1.js | Looping Static Data to Validate URL Link/Text |
dataLoopExample2.js | Looping Static Data to Populate Form Fields |
pageObjectExample1.js | Example how to use page objects |
pageobjects/web-page.js | Example of page objects |
linkTextURL2.js | Link Text/URL Test By Looping Through Elements |
cssValidation1.js | Example how to validate several CSS properties |
dropDownMenu1.js | Example how to validate dropdown menu selections |
carouselExample1.js | Example how to validate image carousels |
screenShot1.js | Example how to take screenshots at different browser widths |
autoComplete1.js | Example how to select and validate autocomplete input field |
iframe1.js | Example how to select / interact multiple iframes on a page |
modal1.js | Example how to interact with a modal window (bootstrap) |
selectBox1.js | Exmample how to interact with selectbox |
saucelabs.js | Example how to use cloud based test site (saucelabs) |
gruntSauceLabs.js | Example how to use grunt + grunt-webdriver + saucelabs |
restAPIExample1.js | Example how to use supertest to test REST APIs |
dbDataLoopExample.js | Example how to use database (mongoDB) driven testing |
excelDataLoopExample.js | Example how to use excel as a data source for test data |
Filename | Description |
---|---|
wdio.conf-tutorial1.js | WDIO config for tutorial1-wdio.js using Firefox |
wdio.conf-copyright1.js | WDIO config for copyright1-wdio.js using Firefox |
wdio.conf-pObjEx1.js | WDio config for pageObjectExample1.js using Firefox |
wdio.conf-gruntfile.js | WDIO config with 3 browser/OS configs against saucelabs |
wdio.conf-saucelabs-dataLoopExample2.js | WDIO config file for dataLoopExample2.js on two different OS/browsers (saucelabs) |
wdio.conf-dataLoopExample2.js | WDIO config file for dataLoopExample2.js on two different browsers (locally) |
Gruntfile.js | Example Gruntfile with grunt-webdriver and 3 browser/OS configs |
Gruntfile-dataLoopExample2.js | Gruntfile for dataLoopExample2.js to run against saucelabs |
Gruntfile-gruntSaucelabs.js | Gruntfile for gruntSaucelabs.js to run against saucelabs |
Filename | Description |
---|---|
testData1.xlsx | excel spreadsheet with test data |
Create selenium directory:
$ mkdir selenium
Install Selenium Stand Alone Server:
Go to http://www.seleniumhq.org/download/
Download jar file (3.0.1 latest at this time)
Save/move into the “selenium” directory
Add "selenium" directory to PATH
Start the Selenium Stand Alone Server (terminal):
$ java -jar selenium-server-standalone-3.0.1.jar
Firefox:
Install firefox browser, if not already installed.
Firefox driver (GeckoDriver):
Go to https://github.com/mozilla/geckodriver/releases
Download latest driver
untar
$ tar -xvf <drivername>
Save/move to "selenium" directory
$ git clone https://github.com/onewithhammer/WebDriverIOTutorial.git
$ cd WebDriverIOTutorial
$ npm install
OR
$ sudo npm install
Run locally single test using mocha as framework and runner:
$ mocha [test-script-filename]
$ mocha tutorial1.js
Note: saucelabs.js & gruntSauceLabs.js - You will need a saucelabs account in order to set the environment variables for SAUCE_USERNAME & SAUCE_ACCESS_KEY
$ export SAUCE_USERNAME=[your saucelabs username]
$ export SAUCE_ACCESS_KEY=[your saucelabs access key]
Run grunt with default config file - Gruntfile.js using mocha as framework & wdio as runner. The config file will run a few test files against saucelabs with different OS/browser combinations.
$ grunt [task-name]
$ grunt webdriver
OR
Run grunt specifying a config file:
$ grunt --gruntfile <config-filename> [task name]
Run locally a single test using mocha as framework and wdio as the runner on 2 OS/browsers:
$ grunt --gruntfile Gruntfile-dataLoopExample2.js webdriver
Run locally single test using mocha as framework and wdio as the runner:
$ wdio [config-filename]
$ wdio wdio.conf-dataLoopExample2.js
Run on saucelabs a single test using mocha as framework and wdio as the runner on 2 OS/browsers:
$ wdio [config-filename]
$ wdio wdio.conf-saucelabs-dataLoopExample2.js
Install json-server
$ npm install -g json-server
Start json-server first with json database file (db.json)
$ cd json-server
$ json-server db.json
see https://github.com/typicode/json-server for github project.
see http://jsonplaceholder.typicode.com/ for working demo online of json-server.
then run script
$ mocha restAPIExample1.js
Use a tool like postman to view the data before and after the script is ran.
Use it.skip() to skip specs.
Note: json-server will update the db.json file.
To restore the original file (stop server first):
cp db-bak.json db.json
Install and make sure mongoDB is running locally then run script
$ mocha dbDataLoopExample.js
see the CHANGELOG
MIT © 2015-2017 Tony Keith tony.keith@yahoo.com WEBSITE
v1.5.0 (2017-02-20)
FAQs
WebDriverIO Tutorial with working web site and examples
The npm package web-driver-io-tutorial receives a total of 8 weekly downloads. As such, web-driver-io-tutorial popularity was classified as not popular.
We found that web-driver-io-tutorial demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.