Protractor: How to stop protractor from closing the session & the browser?Is there a way to store the sessionId to a file in the first run and when we again run the tests, it should pick up the session from the file?

Created on 21 May 2018  路  6Comments  路  Source: angular/protractor

Hi there!

Bug report

  • Node Version: 8.9.4
  • Protractor Version: 5.1.2 Latest version gives same output
  • Angular Version: 1.4.8
  • Browser(s): Chrome
  • Operating System and Version Mac OS 10.13
  • My protractor configuration file
    var multicapabilities=[{
    browserName: 'chrome',
    name: process.env.SUMO_ENV+ ':chrome',
    shardTestFiles: false,
    maxInstances: 100,
    idleTimeout: 600000,
    takesScreenshot:true,
    extendedDebugging : true,
    directConnect: false,
    seleniumAddress: "http://localhost:4444/wd/hub",
    seleniumSessionId: "027ed4e0371e084cc5ae3929b711702e"
    }];

All 6 comments

@Samarth-Sumologic, do you have a relevant example?

The closest I can think of is restartBrowserBetweenTests but since you don't have that set and it defaults to false, you would be keeping the browser and session alive between tests. I don't think that's what you're asking though as that would already work, right?

@simonua Thnx for answering, but yeah I don't want to restart the browser, instead I want my bowser to keep running & the session should also remain alive. So, when I rerun the tests, it should trigger on the same browser with the same session. In that way, I want to soak my tests for a longer duration on the same browser instance.

@Samarth-Sumologic, in that case set restartBrowserBetweenTests to true in your protractor config.

@simonua I don't want that flag, because I don't want the browser to restart. I am not talking about keeping browser open for different specs, rather I want when all my tests are over, the browser & session should remain alive, & when I again give command to run all my tests again, it should run on that same browser & session.

My apologies. I didn't read and interpret "rerun" correctly in your first reply. I can't think of a way to do this, I'm afraid.

@smathur96 Hi Samarth, did you find a way to do this?

Was this page helpful?
0 / 5 - 0 ratings