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

node-red-contrib-selenium-webdriver

v0.2.14

Published

A selenium-webdriver nodes for Node-RED

Downloads

32

Readme

node-red-contrib-selenium-webdriver

The automation framework which allows to create UI test flow by visual IDE tool for web application

npm version npm Docker Pulls

Local Development Environment

Install Selenium Server

npm install -g webdriver-manager

Setting up a Selenium Server

Prior to starting the selenium server, download the selenium server jar and driver binaries. By default it will download the selenium server jar and chromedriver binary.

webdriver-manager update

Starting the Selenium Server

By default, the selenium server will run on http://localhost:4444/wd/hub.

webdriver-manager start

Install Node-RED and nodes

npm install -g --unsafe-perm node-red

cd ~/.node-red && npm install node-red-contrib-selenium-webdriver

Automated UI Test /w Docker Environment

  1. Install Docker Tool Box from https://www.docker.com/products/docker-toolbox

  2. Create docker-compose.xml to your local folder

    version: '2'
    services:
      node-red:
        image: cuongquay/node-red-ui-automation
        ports:
         - 1880:1880
      selenium-hub:
        image: selenium/hub
        ports:
         - 4444:4444
      node-chrome:
        image: selenium/node-chrome
        depends_on:
         - selenium-hub
        environment:
         - HUB_PORT_4444_TCP_ADDR=selenium-hub

3. Run with **docker-compose up** command

eval "$(docker-machine env default)" docker-compose up -d --force-recreate


4. Launch Kitematic, choose **node-red-ui-automation** container and look for the Access URL from HOME tab. 

5. Browsing the application by http://ACCESS_URL:1880/ (usually it's http://192.168.99.100:1880/)


**Example flow**

```javascript
[{"id":"fb07c885.3874c8","type":"function","z":"a3fe32e2.a1b96","name":"ErrorHandle","func":"if (msg.error) {\n    msg.statusCode = 400;\n    msg.payload = msg.error;\n}\nreturn msg;","outputs":1,"noerr":0,"x":830,"y":140,"wires":[["2f3d9e67.eb9d52"]]},{"id":"e1d1fc61.92093","type":"inject","z":"a3fe32e2.a1b96","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":100,"y":60,"wires":[["b334ff56.fb323"]]},{"id":"2f3d9e67.eb9d52","type":"debug","z":"a3fe32e2.a1b96","name":"","active":true,"console":"false","complete":"false","x":990,"y":140,"wires":[]},{"id":"b334ff56.fb323","type":"open-web","z":"a3fe32e2.a1b96","name":"","weburl":"https://www.google.com/","width":"480","height":"640","webtitle":"Google","timeout":"3000","maximized":false,"server":"d404327f.b8517","x":270,"y":60,"wires":[["aa60f00c.b5221"]]},{"id":"473291bb.ff669","type":"close-web","z":"a3fe32e2.a1b96","name":"","waitfor":"1500","x":670,"y":140,"wires":[["fb07c885.3874c8"]]},{"id":"ae932825.695ad8","type":"delay","z":"a3fe32e2.a1b96","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":520,"y":140,"wires":[["473291bb.ff669"]]},{"id":"aa60f00c.b5221","type":"find-object","z":"a3fe32e2.a1b96","name":"","selector":"name","target":"btnK","timeout":"1000","waitfor":"1500","x":460,"y":60,"wires":[["bc933182.599ed"]]},{"id":"bc933182.599ed","type":"get-value","z":"a3fe32e2.a1b96","name":"CheckButton","expected":"Tìm với Google","selector":"name","target":"btnK","timeout":"1000","waitfor":"1500","savetofile":false,"x":650,"y":60,"wires":[["62aa9f69.b07a8"]]},{"id":"62aa9f69.b07a8","type":"send-keys","z":"a3fe32e2.a1b96","name":"","text":"cuongdd1","selector":"xpath","target":"//*[@id=\"lst-ib\"]","timeout":"1000","waitfor":"1500","clearval":false,"x":830,"y":60,"wires":[["b72c1331.d769d"]]},{"id":"1fb4e2ff.3a2a2d","type":"click-on","z":"a3fe32e2.a1b96","name":"","selector":"name","target":"btnG","timeout":"10000","waitfor":"1500","clickon":false,"x":180,"y":140,"wires":[["1d0e4aca.6e3825"]]},{"id":"1d0e4aca.6e3825","type":"run-script","z":"a3fe32e2.a1b96","name":"","func":"\nreturn arguments[0].innerHTML;","selector":"name","target":"","timeout":"10000","waitfor":"1500","x":350,"y":140,"wires":[["ae932825.695ad8"]]},{"id":"7689f307.deb30c","type":"link in","z":"a3fe32e2.a1b96","name":"","links":["b72c1331.d769d"],"x":35,"y":140,"wires":[["1fb4e2ff.3a2a2d"]]},{"id":"b72c1331.d769d","type":"link out","z":"a3fe32e2.a1b96","name":"","links":["7689f307.deb30c"],"x":955,"y":60,"wires":[]},{"id":"d404327f.b8517","type":"selenium-server","z":"a3fe32e2.a1b96","remoteurl":"http://localhost:4444/wd/hub","browser":"chrome"}]

Demo Screenshot

Demo Demo