Tibeben
Tibeben

Reputation: 181

Is it possible to not shutdown webdriver between two protractor spec execution?

I would like to run separate protractor specs without closing the browser in between.

Something like:

The goal is to keep the context between the protractor specs execution.

Is it possible?

Correction and Additional information:

My need is to keep the browser opened between two separate test suites (in separate files) and not between two tests. I'm using IE11 alongside selenium standalone server.

Thank you.

Upvotes: 2

Views: 130

Answers (1)

AdityaReddy
AdityaReddy

Reputation: 3645

Protractor by default doesnt close the browser between each session unless you specifically ask it do so. The below option in config file controls that.

/** * If true, protractor will restart the browser between each test. Default * value is false. * * CAUTION: This will cause your tests to slow down drastically. */

restartBrowserBetweenTests?: boolean;

Looks like your requirement is

  1. Execute Spec 1
  2. Execute some task outside browser(non-protractor work)
  3. Then Execute Spec 2

Normally how I implement this is - lets say I have a task to validate & confirm email from my outlook , which is a non-protractor task before I run next test case, I just throw an alert at the end of my 1st test case asking the tester to manually verify the email and then accept the alert on the browser and then I will proceed with the second test case

Upvotes: 0

Related Questions