Rajit Garg
Rajit Garg

Reputation: 539

how to close browser after execution of all testcase or after fail of testcase with protractor using selenium server with angularjs

I am able to run testcases with protractor using selenium server with angularjs

I want to close my browser after execution of all testcase or after fail of testcase,

I am able to do this by writing browser.close() in the last testcase, but this will not work if testcase fails, is there any other way to close the browser in this case also, or is there any different name for after like afterEach?

Thanks in advance.

Upvotes: 1

Views: 3342

Answers (1)

Umesh Kumar
Umesh Kumar

Reputation: 1397

once you login check for the title of the page, if it not desired page then you can call driver.quit else continue with your exection

Upvotes: 1

Related Questions