Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
webdriver-reuse-session
Advanced tools
Manage Webdriver sessions and make sessions id's available for e.g. Protractor and other TDD and BBD tools
If you want better, faster and more enjoyable test, then this is the place to be
Protractor is a nice an well-behaving tool, so it closes the browsers it creates, but sometimes you want to keep it open for debugging purposes or for speeding up the next test.
And Protractor actually supports attaching to browsers, but it needs some manual to start the browser.
This tool can..
Start Webdriver, Selenium or ChromeDriver sessions and make sessions id's available for Protractor and similar Web Browser Test Automation Frameworks
The normal approach is that every test run starts a new browser, which often takes between 5 to 10 seconds. Using webdriver-reuse-session 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.
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
If you ...
Make an issue or a pull request or reach out to me via email - andreas@markussen.dk .
npm install webdriver-reuse-session
The 'webdriver-reuse-session' script can be used both in a manual mode and in an automatic mode.
npm webdriver-manager start
webdriver-reuse-session
Setup your script to use a local host Selenium
/** in your protractor.conf.js or similar config object*/
directConnect: undefined, // can be omitted, but just to show that directConnect must not be set
seleniumAddress: 'http://localhost:4444/wd/hub',
Use the SessionID in the command line
protractor --seleniumSessionId=6aec0d5861daa54d0b9be17ec47bea70
Get the SessionID
const sessionIdFromFile = fs.readFileSync('.seleniumSessionId.txt')
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,
It is independent of the test runner, it depends on how you define your Selenium Session ID.
You can use this with Cucumber, Mocha, Jest and other test automation frameworks
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
FAQs
Manage Webdriver sessions and make sessions id's available for e.g. Protractor and other TDD and BBD tools
We found that webdriver-reuse-session demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.