webdriveerio (webdriverJS + cheerio)
This module is a cheerio JQuery core implementation binded with a webdriverJS driver. With webdriveerio you can manipulate (like JQuery) HTML nodes from a web site page source code, and trigger actions over them like in a real browser, using webdriverJS over a selenium server.
You have a webdriverJS driver with a new command called "query". You can call this command with a selector and a callback that receive a "list" of element getting from the page loaded on the driver. Each of this elements are extended with the action methods that the webdriverJS driver has:
addValue buttonClick clearElement click doubleClick dragAndDrop moveToObject setValue
These methods are the same as the dirver methods but without selector argument (css selector), because the target element is defined by the node on which the method was called, so you do not need to pass a selector. This allow you to write code to programatically select nodes and perform actions over them, instead of being limited to select them using css selectors only.
How to install it
npm install webdriveerio
In the examples folder you'll find test.js file that search into checkbox-list.html some checkboxes and click the ones that match a rule (amount of "things" between 5 and 12).
var wd = ;var options = desiredCapabilities: browserName: 'chrome' ;var driver = wd;// EXAMPLE:// we will clck only checkboxes with an amount of things between 5 and 12;driver;
The above code click a selection of items, iterating over inputs and programatically decide wich has to be clicked depending on the weight of a number into the text of the label. It could not be posible using css selectors only.
The list of checkboxes is like this:
...12 things20 things3 things5 things8 things14 things...
So test.js will click on "12 things", "5 things" and "8 things" checkboxes.