Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

256
Views
No valid session ID in Selenium when running multiple tests

I want to run multiple tests but after the first run I get an error: UnhandledPromiseRejectionWarning: NoSuchSessionError: This driver instance does not have a valid session ID (did you call WebDriver.quit()?) and may no longer be used . It seems like that the second run doesn't get session id.

My code looks like this (the main bit):

runTests = async () => {
    for (let i = 0; i < results.length; i++) {
        await subscribe('urlgoeshere');
    }
};
runTests();

async function subscribe(url) {
    try {
        await driver.get(url);
    }
    catch(err) {
        console.error(err);
    }
    finally {
        await driver.quit();
    }
}
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!