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 🙏

© 2025 – Pkg Stats / Ryan Hefner

selenium-extend

v0.0.5

Published

extension to make webdriverjs less async

Readme

selenium-extend

selenium-extend is an npm module that makes async selenium-webdriver code a lot more sane. It's most valuable when used in conjunction with the selenium chromedriver and makes working with chrome extensions in the context of the chromedriver much easier.

selenium-extend does not overwrite existing driver functionality. selenium-extend adds an object named extend with various methods that wrap selenium-webdriver functions into functions that make sense in the context of navigating a browser.

##Installation

npm install --save selenium-extend

##Initialization

Creating a new driver with extend methods:

var extend = require('selenium-extend');

// constructing raw chrome
var driverPath = "path/to/chromedriver";
var driver = extend.createChrome(driverPath); //returns a Chrome WebDriver

// constructing chrome with an extension
var extensionPath = "path/to/chrome/extension/folder"; //unpacked chrome extension
var driverPath = "path/to/chromedriver";
var driver = extend.createChromeWithExtension(extensionPath, driverPath);

Adding extend methods to an existing driver:

var extend = require('selenium-extend');

extend.addExtend(driver);

You can also set the maximum wait time for async events:

extend.setWaitTime(10000); // sets maximum wait time to 10000ms
                           // default WAITTIME is 10000ms

##API

Enable incognito for chrome extensions/selenium web driver:

driver.extend.enableIncognito();  // enables for both selenium and extension

driver.extend.enableIncognito(n); // enables for up to n extensions, in order
                                  // from first to last, selenium is always
                                  // the first extension

Check is an element is clickable:

var clickable = driver.extend.isClickable(css); // returns boolean true or false
                                                // waits until WAITTIME
                                                // css is a css selector

Click on an element:

driver.extend.click(css); //css is selector

Double click on an element (really useful for selecting all in input):

driver.extend.doubleClick(css);

Check if an element exists:

driver.extend.exists(css);

Get the text value of an element:

driver.extend.getText(css);

Get the value of an element (input):

driver.extend.getValue(css);

Emulate selecting text in DOM with a mouse pointer:

// offset1 and 2 are the character offsets of the text node to highlight text in
driver.extend.selectText(css, offset1, offset2);

Type text into an element:

driver.extend.typeText(css, "text to type in element");

Switch to the next window:

driver.extend.toNextWindow();

Scroll browser to element:

driver.extend.moveToElement(css);

##Future

The following are still to be done: --tests --constructors for other browsers --any other types of browser interactions (e.g. hover, scroll, double click, etc)

##License Created by Shri Ganeshram, please attribute in forks. Licensed under the MIT License.