Skip to content

Instantly share code, notes, and snippets.

@Damian89
Created April 1, 2020 19:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Damian89/e0767e74fb4320cfb6b84fd43af3309e to your computer and use it in GitHub Desktop.
Save Damian89/e0767e74fb4320cfb6b84fd43af3309e to your computer and use it in GitHub Desktop.
const {Builder, By, until} = require('selenium-webdriver');
new Builder()
.forBrowser('firefox')
.build()
.then(driver => {
return driver.get('http://www.google.com/ncr')
.then(_ => driver.findElement(By.name('q')).sendKeys('webdriver'))
.then(_ => driver.findElement(By.name('btnK')).click())
.then(_ => driver.wait(until.titleIs('webdriver - Google Search'), 1000))
.then(_ => driver.quit());
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment