Skip to content

Instantly share code, notes, and snippets.

@crossan007
Created September 7, 2019 14:21
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 crossan007/f04fd9caca244482272a2d627daae389 to your computer and use it in GitHub Desktop.
Save crossan007/f04fd9caca244482272a2d627daae389 to your computer and use it in GitHub Desktop.
var webdriver = require('selenium-webdriver'),
By = webdriver.By,
until = webdriver.until;
var driver = new webdriver.Builder()
.forBrowser('chrome')
.build();
driver.get('http://www.webdriverjs.com/');
driver.findElement(By.css('.search-field.form-control')).sendKeys("WebdriverJs");
driver.findElement(By.css('button.search-submit i')).click();
driver.wait(until.elementTextIs(driver.findElement(By.css('.vl-main-header>h1')), "Search Results for: WebdriverJs"), 10000);
driver.quit();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment