Hi,
I am trying to execute 10 test cases and I am using approach 1 which was mentioned in below link.
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
Solved! Go to Solution.
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); } }
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,
Could you please explain me with the code? I am trying to kill the running browser but not getting.
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); } }
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.
I would actually include that code within the Login.... that before you login, you first terminate all browsers then run the browser.
Thank you tristaanogre.
I kept in Login method, before logging am killing the instance of the browser.
It's working fine.
Thanks.
Regards,
Saritha.
Subject | Author | Latest Post |
---|---|---|