npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

leanft-selenium-js-sdk

v1.0.2

Published

The LeanFT SDK for Selenium

Readme

leanft-selenium-js-sdk

LeanFT JavaScript SDK for Selenium

LeanFT for Selenium JavaScript SDK extends the Selenium WebDriver API with locators and utilities that enable creating tests that are more robust, and reduces Selenium test automation and maintenance efforts.

Install

npm install leanft-selenium-js-sdk --save

Usage Example

The following example demonstrates locating elements by their visible text.

var webdriver = require("selenium-webdriver");
var Builder = webdriver.Builder;
var LeanFT4S = require("leanft-selenium-js-sdk");
var By = LeanFT4S.By(webdriver.By);

var driver = new Builder().forBrowser("chrome").build();

driver.get("http://www.google.com/en");

// Locates the "Google Search" button
var element = driver.findElement(By.visibleText("Google Search"));

driver.quit();

The following example demonstrates locating elements using a regular expression.

var webdriver = require("selenium-webdriver");
var Builder = webdriver.Builder;
var LeanFT4S = require("leanft-selenium-js-sdk");
var By = LeanFT4S.By(webdriver.By);

var driver = new Builder().forBrowser("chrome").build();
driver.get("http://www.google.com");

var element = driver.findElement(By.name(/^btn/));

driver.quit();

Locate an element using its HTML attributes and highlight it.

var webdriver = require("selenium-webdriver");
var Builder = webdriver.Builder;
var LeanFTForSelenium = require("leanft-selenium-js-sdk");
var Utils = LeanFTForSelenium.Utils;
var By = LeanFTForSelenium.By(webdriver.By);

var driver = new Builder().forBrowser("chrome").build();

driver.get("http://www.google.com");

var element = driver.findElement(By.attributes({
	"class": "gsfi lst-d-f",
	"id": "lst-ib"
}));

Utils.highlight(element);

driver.quit();

API

LeanFT for Selenium API reference documentation can be found here

New Locators

By.visibleText

Returns a new locator that enables finding elements based on their visible text.

By.visible

Returns a new locator that enables finding elements based on their visibility.

By.role

Returns a new locator that enables finding elements based on their role.

By.type

Returns a new locator that enables finding elements based on their type.

By.attributes

Returns a new locator that enables finding elements based on their attributes (one or more). Attribute values can be defined using regular expressions.

By.styles

Returns a new locator that enables finding elements based on their computed style (one or more). Computed style values can be defined using regular expressions.

By.each

Returns a new locator that enables finding elements based on a combination of locators (attributes, tags, styles etc.).

By.any

Returns a new locator that locates elements that match at least one of the locators provided (OR).

By.chained

Returns a new locator that locates elements by using locators that describe the elements and their ancestors (higher level elements).

Regular Expression Support

All the locators which accept a string as a value of the element's property, were extended to support regular expressions including the following Selenium native locators:

  • By.id
  • By.className
  • By.linkText
  • By.name
  • By.tagName

Utilities

Utils.getSnapshot

Returns a snapshot (image) of the selenium element as a Base64 string.

Utils.highlight

Highlights the selenium element in the browser.

build

To build the project, clone it and run the following command:

npm install gulp -g
npm install
gulp build

Running Test

To run the unit-tests of the project after you have built it run the following command:

gulp test