cancel
Showing results for 
Search instead for 
Did you mean: 

Leave site pop up is getting displayed if I use stop test item on error.

SOLVED
Highlighted
Contributor

Leave site pop up is getting displayed if I use stop test item on error.

Hi,

I am trying to execute 10 test cases and I am using  approach 1 which was mentioned  in below link.

https://support.smartbear.com/testcomplete/docs/testing-with/running/control-test-flow/stop-after-fi...

When object is not find for one test case I am trying to stop that test case and continue with remaining.

But following pop up is getting displayed.(Capture.png)

Becuase of this remaining test cases not excuting. 

 

Do I need to write script for handling this pop up also or am I missing something?

Could you please some one explain how to stop test item on error.

 

Thanks in advance.

 

Regards,

Saritha

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Hero

Re: Leave site pop up is getting displayed if I use stop test item on error.

For help with your code, it would be useful for you to share it here.

However, here is the method we use for our own "tear down".  

 

function closeIEInstance() {
    var counter = 0;
    var browser;
    browser = Sys.WaitBrowser('iexplore', 1000);
    while((browser.Exists) && (counter < 60)){
        counter++;
        browser.Terminate();
        browser = Sys.WaitBrowser('iexplore', 1000);
    }  
} 

Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Extensions available
6 REPLIES 6
Community Hero

Re: Leave site pop up is getting displayed if I use stop test item on error.

Think about manual test cases.  When you start a test case, you expect your application and environment to be in a particular state. So, before you start your test case, you make sure you get your environment in that state.  Likewise, when you finish the test case, you clean up the environment, closing applications and so forth.

 

The same is the case with automated test cases.  What it sounds like is that there are "tear down" processes that need to be run when a test case stops.... so, yes, you do need to code for it.  Since, however, this is a web application, what I would suggest is what we do at the start of every test case... we kill any running browsers and start fresh with any "setup" code...the idea is that each test case is autonomous and can run independantly of any other,


Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Extensions available
Contributor

Re: Leave site pop up is getting displayed if I use stop test item on error.

Could you please explain me with the code? I am trying to kill the running browser but not getting.

 

Thanks in advance.

 

Regards,

saritha.

Community Hero

Re: Leave site pop up is getting displayed if I use stop test item on error.

For help with your code, it would be useful for you to share it here.

However, here is the method we use for our own "tear down".  

 

function closeIEInstance() {
    var counter = 0;
    var browser;
    browser = Sys.WaitBrowser('iexplore', 1000);
    while((browser.Exists) && (counter < 60)){
        counter++;
        browser.Terminate();
        browser = Sys.WaitBrowser('iexplore', 1000);
    }  
} 

Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Extensions available
Contributor

Re: Leave site pop up is getting displayed if I use stop test item on error.

Thanks for the code.

 

Could you please tell me Where I need to call this method?  Please find attachment for test case strucuture.(Capture 1.png)

 

In login method I have below steps:

1. Navigate to URL

2. Enter username

3. Enter password.

4. Click on submit

 

In logout method I have below steps:

If any modal open first close that modal and click on logout.

 

Now while executing if error comes where i need to call this method for terminating browser?

 

Thanks in Advance,

 

Regards,

Sairtha.

 

 

 

 

Community Hero

Re: Leave site pop up is getting displayed if I use stop test item on error.

I would actually include that code within the Login.... that before you login, you first terminate all browsers then run the browser.


Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Extensions available
Contributor

Re: Leave site pop up is getting displayed if I use stop test item on error.

Thank you 

 

 

 

New Here?
Join us and watch the welcome video:
SeptemberNews
Join the September Hub-bub to show off, learn and win