webdriver-sizzle

Locate a selenium-webdriver element by sizzle CSS selector

webdriver-sizzle

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);
});