Ask a Question

How can we close browser when test fail

SOLVED
sudam_SL
Contributor

How can we close browser when test fail

Is there any way to close the browser instance when the test case gets failed? (otherwise, it trying to continue the next test case on the same browser instance) i need to start each test with the new browser instance. please help me with this.

3 REPLIES 3
vinniew
Staff

Hi @sudam_SL 

 

Hope you are well. 

 

We could use an event handler for this, more specifically  OnStopTest/OnStopTestCase events.

For the general description of TestComplete events see 

 

https://support.smartbear.com/testcomplete/docs/testing-with/advanced/handling-events/about.html, https://support.smartbear.com/testcomplete/docs/testing-with/advanced/handling-events/creating-handl... 

 

There is also a thread about this 

 

https://community.smartbear.com/t5/TestComplete-Questions/Close-specific-browser-script-error/m-p/15...

 

KR

Vincent 

sonya_m
SmartBear Alumni (Retired)

Thanks vinniew!

 

Hi @sudam_SL! Doep the reply help? Please let the Community know.


Sonya Mihaljova
Community and Education Specialist

Hi @vinniew 

 

Thanks for the reply.

Can we do it with Keyword Test? i'm building my test with Keyword test.

 

Thanks,

Sudam.

cancel
Showing results for 
Search instead for 
Did you mean: