npm

Need private packages and team management tools?Check out npm Orgs. »

webdriver-sizzle-promised

2.0.2 • Public • Published

Locate a selenium-webdriver element by sizzle CSS selector.

Everything returns a promise

$ and $.all return a Q promise.

Methods on Selenium WebElements and arrays of WebElements will also return a Q promise instead of a Selenium promise.

Usage

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

install

npm i webdriver-sizzle-promised

Downloadsweekly downloads

203

version

2.0.2

license

MIT

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability