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

webdriver-marker

v0.0.1

Published

Highlight WebElements while running selenium-webdriver based scripts for increased visibility or debugging

Downloads

10

Readme

#Webdriver-Marker ###Summary Webdriver-Marker is a selenium-webdriver utility module for adding border and background styling to WebElements while running a selenium-based script. It has currently only been tested against drivers generated by the Builder class of selenium-webdriver ###TODO: Class Docs index.js currently has jsdoc comments on the file itself until I get something hooked up to generate the md ###Code Examples #####Creating an instance of Marker and applying universal styles for the instance var webdriver = require('selenium-webdriver'), By = webdriver.By, until = webdriver.until;

var driver = new webdriver.Builder()
    .forBrowser('chrome')
    .usingServer('http://192.168.99.100:4444/wd/hub')//used for my docker container can comment out for localhost or change
    .build();

var Marker = require('webdriver-marker')

//regular marker with no additions to the default preferences
var defaultMarker = new Marker(driver)
//greenMarker gets created with overrides default prefs for EVERY time it is called
var greenMarker = new Marker(driver, {background:'green', showFor:5000})

#####Highlight elements for a short time then automatically remove the highlight var defaultMarker = new Marker(driver) driver.get('http://www.google.com'); defaultMarker.highlightElementFor(By.name('q')).sendKeys('webdriver'); driver.sleep(5000) defaultMarker.highlightElementFor({name:'btnG'}).click(); driver.wait(until.titleIs('webdriver - Google Search'), 1000); driver.sleep(10000) driver.quit();

#####Highlight elements until the styles are explicitly removed var defaultMarker = new Marker(driver) driver.get('http://www.google.com'); defaultMarker.highlightElement(By.name('q')).sendKeys('webdriver'); driver.sleep(5000) defaultMarker.removeHighlight(By.name('q')); defaultMarker.highlightElement({name:'btnG'}).click(); driver.wait(until.titleIs('webdriver - Google Search'), 1000); driver.sleep(5000) defaultMarker.removeHighlight({name:'btnG'}); driver.quit();

#####Using different Markers/styles in the same script var defaultMarker = new Marker(driver) driver.get('http://www.google.com'); defaultMarker.highlightElementFor(By.name('q')).sendKeys('webdriver'); driver.sleep(5000) greenMarker.highlightElementFor({name:'btnG'}).click(); driver.wait(until.titleIs('webdriver - Google Search'), 1000); driver.sleep(10000) driver.quit();