Forum Discussion

nakshatra's avatar
nakshatra
Contributor
6 years ago

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-first-error-and-continue.html

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

 

 

  • 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);
        }  
    } 
  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    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,

    • nakshatra's avatar
      nakshatra
      Contributor

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

       

      Thanks in advance.

       

      Regards,

      saritha.

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        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);
            }  
        }