New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

webdriver-reuse-session

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webdriver-reuse-session

Manage Webdriver sessions and make sessions id's available for e.g. Protractor and other TDD and BBD tools

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

webdriver-reuse-session

Manage Webdriver/Selenium/Chromedriver sessions and make sessions id's available for e.g. Protractor and other TDD and BBD tools.

Speed up your tests

Using this can take between 5-10 seconds of your start-up time, and sometimes even more. If you have an authentication step, then this can be added. I worked a case, where I could cut off 30 seconds of overhead, every time I wanted to run a 5 seconds test.

Other tips

Resist the temptation of using ts-node, unless you are doing it for the sake of debugging. Have a terminal running next to your other terminal with 'tsc -w' This is so much faster

Assumptions

  1. The local selenium/webdriver host is always http://localhost:4444/wd/hub
  2. The way to control a Web Driver is best done using webdriver-manager. I assume that you have this installed
  3. The best way to work with multiple browser types is [Protractor](https://www.protractortest.org/#/(https://w3c.github.io/webdriver/)

If you ...

  • believe that my assumptions are flawed...
  • have found a bug...
  • need something else...

Make an issue or a pull request or reach out to me via email - andreas@markussen.dk .

Installation

npm install webdriver-reuse-session

Usage

Start a browser or find a Chrome Browser

  1. Start Webdriver-manager or a raw selenium
npm webdriver-manager start
  1. Start the reuse sessions script
webdriver-reuse-session

From your test tool

  1. Get the SessionID

    const sessionId = fs.readFileSync('.seleniumSessionId.dat')
    
  2. Use the SessionID

    /** in your protractor.conf.js or similar config object*/
    
    directConnect: undefined,  // can be omitted, but just to show that directConnnect must not be set
    seleniumAddress: 'http://localhost:4444/wd/hub',
    seleniumSessionId: sessionIdFromFile,
    

Feedback and Issues

This is my first package on NPMJS, so feel free to give me feedback and log issues on Github

With wishes of faster testing for all of us,

Andreas

Keywords

FAQs

Package last updated on 29 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc