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 node
nvm:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
brew install yarn
brew cask install google-chrome
brew install chromedriver
brew cask install firefox
brew cask install geckodriver
Clone the repository:
git clone https://github.com/remarkablemark/webdriverjs-recipes.git && cd webdriverjs-recipes
Use Node.js version:
nvm use
Install the dependencies:
yarn
In 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 build
Launches 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.