Dejan Jankovic
Dejan Jankovic

Reputation: 173

Protractor: Can I proceed with execution of the test if I close browser earlier in it?

I have a question: Is it posible to continue with execution of one test, if I have earlier closed browser in it?

For example, I want to check is the user in my application logged in, even when I restart browser. I want to check that with and without "Remember me" checkbox.

After I login my user in app, I try with this:

browser.close();

but test ends and can not be continued further. If i try with this:

browser.get("");
browser.get("about:blank");

only blank tab is open, and test ends.If I try with:

browser.quit();

than whole session is killed and test is ended,

If anyone knows solution, or have some ideas, please answer. Thanks

Upvotes: 7

Views: 2589

Answers (1)

Jmr
Jmr

Reputation: 12118

You'll be able to do this with the next release of Protractor, which includes the new browser.forkNewDriverInstance function. This lets you create a new instance of your browser via webdriver. See the commit (https://github.com/angular/protractor/commit/0bbfd2b6d38392938781d846ad37b5a0fd964004) for more information.

Upvotes: 2

Related Questions