Recipes and examples of how to perform automation with WebDriverJS (Selenium for Node.js).
See API documentation for more information on selenium-webdriver.
brew install nodenvm:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bashbrew install yarnbrew cask install google-chromebrew install chromedriverbrew cask install firefoxbrew cask install geckodriverClone the repository:
git clone https://github.com/remarkablemark/webdriverjs-recipes.git && cd webdriverjs-recipesUse Node.js version:
nvm useInstall the dependencies:
yarnIn the project directory, you can run:
Automates a Firefox browser using async/await. See article.
Builds driver with Firefox browser.
To build driver with Chrome browser:
SELENIUM_BROWSER=chrome yarn buildLaunches Chrome profile page. See article.
The profile data is saved at ./my_profile_path/.
Runs browser automation test written in Cucumber. See artcile.
Finds elements. See article.
Runs browser automation test with Jest.
Runs browser automation test with Mocha. See article.
Gets the browser resource file URL's of a webpage. See article.
Takes and saves a screenshot to ./screenshot.png.
Waits until condition is true.