there are two it() testcases in protractor
it('it1',function(){
});
it('it2',function(){
});
does the driver in protractor quits after completing it1?
Can we make protractor not to quit the driver?
Take this example and let Protractor run it for you:
describe('describe1', function () {
it('it1', function () {
browser.get('http://www.angularjs.org');
});
it('it2', function () {
element(by.linkText('View on GitHub')).click();
browser.sleep(3000); // Here you should se that you are now on GitHub
});
});
You should notice that it2 operates on the same driver. These two specs are both successful and couldn't be that if the browser quit in between the specs. We could add an afterEach
where in we do a browser.quit()
to prove that. The output of adding that afterEach
is:
Error: This driver instance does not have a valid session ID (did you call WebDriver.quit()?) and may no longer be used.
This should prove that the browser isn't quitted in between specs. The driver is quitted on the end of all suites though. But at that point you are already finished with all interactions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With