node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

webdriver-sizzle

webdriver-sizzle NPM version Build Status

Locate a selenium-webdriver element by sizzle CSS selector.

var selenium = require('selenium-webdriver'),
    sizzle = require('webdriver-sizzle'),
    driver = new webdriver.Builder()
      .withCapabilities(webdriver.Capabilities.phantomjs())
      .build()
    $ = sizzle(driver)
 
// Find the first element with class btn and click it 
$('.btn').click()
 
// Count the paragraphs 
$.all('p').then(function (elements) {
  console.log(elements.count);
});