Skip to content

Instantly share code, notes, and snippets.

@jiang-wei
Created August 17, 2018 15:45
Show Gist options
  • Save jiang-wei/3d5a0701ec654b9f13122a55fd5ee7c2 to your computer and use it in GitHub Desktop.
Save jiang-wei/3d5a0701ec654b9f13122a55fd5ee7c2 to your computer and use it in GitHub Desktop.
WebDriverJs example
const {Builder, By, until} = require('selenium-webdriver');
let driver = new Builder()
.forBrowser('firefox')
.build();
driver.get('http://www.google.com/ncr');
driver.findElement(By.name('q')).sendKeys('webdriver');
driver.findElement(By.name('btnK')).click();
driver.wait(until.titleIs('webdriver - Google Search'), 1000);
driver.quit();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment