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 🙏

© 2024 – Pkg Stats / Ryan Hefner

trueautomation-selenium-webdriver

v0.3.11

Published

TrueAutomation.IO selenium-webdriver support

Downloads

6

Readme

TrueAutomation.IO selenium-webdriver extension

This module allows to use TrueAutomation.IO with selenium-webdriver.

Installation

{
  "devDependencies": {
    "trueautomation-selenium-webdriver": "~0.3",
    "trueautomation-helper": "~0.3"
  }
}

Usage

TrueAutomation.IO extension provides an own Builder and ServiceBuilder for selenium-webdriver

Builder initialization

Use Builder provided by TrueAutomation.IO instead of original one:

const { Key, until } = require('selenium-webdriver');
const { Builder, By } = require('trueautomation-selenium-webdriver');
const { ta } = require('trueautomation-helper');

(async function example() {
  const driver = new Builder().forBrowser('chrome').build();

  try {
    await driver.get('http://www.google.com/ncr');
    await driver.findElement(By.name(ta('test:test:test', 'q'))).sendKeys('webdriver', Key.RETURN);
    await driver.wait(until.titleIs('webdriver - Google Search'), 1000);
  } finally {
    await driver.quit();
  }
})();

You can use it for remote webdriver as well

  const driver = new Builder().usingServer('http://remote.host:4455').forBrowser('chrome').build();

You can use driver manually by setting corresponding parameter in capabilities

  const caps = {
    'browserName': 'firefox',
    'driver': 'geckodriver',
    'driverVersion': '0.24.1',
  }
  const driver = new Builder().withCapabilities(caps).build();

Service initialization

Use provided ServiceBuilder to create a new service.

  const service = new ServiceBuilder().loggingTo('./trueautomation.log').driverTo('chromedriver', '<driverVersion>').build();
  const options = Capabilities.chrome();
  const driver = chrome.Driver.createSession(options, service);

Use CapabilitiesBuilder to connect to a remote webdriver.

  const service = new ServiceBuilder().loggingTo('./trueautomation.log').build();
  const options = new CapabilitiesBuilder(Capabilities.chrome()).withRemoteAddress('http://remote.host:4455/wd/hub').build();
  const driver = chrome.Driver.createSession(options, service);

Using

Class By has been extended by the method ta which takes the name of TA smart locator stored in the repository. To use a TA smart locator, connect the class By with the "trueautomation-selenium-webdriver" module. See the example below:

const { By } = require('trueautomation-selenium-webdriver');

await driver.findElement(By.ta('test:test:test'));