This is a migrated thread and some comments may be shown as answers.

test list on silverlight, once fail causes all to fail

6 Answers 46 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Joseph
Top achievements
Rank 1
Joseph asked on 07 Jun 2013, 09:59 AM
Hi,

im running the trial version of test studio, im currently trying it on our silverlight application, i am trying to add 100 users in but if it fails a step it seems to crash the browser and never recover causing the remaining tests to all fail.

the way the test is run is by clicking the search box at the top of the page then enter a name etc, this bar is always visible throughout the test, but when the test fails it doesnt seem to be able to locate this box at the start of the next test,

currently i have the test setup up in two stages, login > add users (data source 100) so it should only log in once then run through the data source.

is there a way i can put it a force browser close on fail? or on fail open new browser? then restart the test from a certain point e.g. login

basically i need to know if i can close and reopen a browser if it has failed or browser is not responding

thanks in advance

6 Answers, 1 is accepted

Sort by
0
Velin Koychev
Telerik team
answered on 07 Jun 2013, 03:19 PM
Hi Joseph,

Thank you for trying Test Studio.

When the browser is not responding Test Studio should fail the test and close the active browser(this is the expected behavior). However sometimes in this situation Test Studio fails to do so. The best feature to handle this case is to enable KillBrowserProcessOnClose in your Test List settings. This will forcefully terminate the browser's process and Test Studio will continue with the next test in the list.

About your second issue - how to make other tests continue without failing there are two approaches:
1) Make the first step of the test a step that clears all cookies from the active browser. After this step you can always perform the login step.  A lot of QA experts consider this approach as the best option.

I would also recommend you to use the option Test as Step for the login steps. This feature allows you to run an existing test as a single step within another test. This can help to reuse the steps among other tests. Just put the steps in a separate test and after that use the Test as Step function to execute them in the main test. You may find Create Test as Step option also useful in this situation.  

2) Another way to handle this problem is to include a logical step like If...Else. You can verify if you are not   already logged and if that is the case - to execute the login steps. Here you could also use the above recommendation with Test as Step feature. 

I hope this helps.

Regards,
Velin Koychev
Telerik
Free summer webinars on advanced web automation tactics hosted by Jim Holmes & Adam Goucher.
Reserve your seat today!
0
Joseph
Top achievements
Rank 1
answered on 10 Jun 2013, 08:26 AM
  • Thank you for the reply, I'm already using the test as step function for my login details, but I assumed this was only ever hit once,  which is mentioned here.
  • So my understanding was that if a step fails, it would only 'restart' from the top of the data sourced step, so login would never be hit again after it had been hit once?

I have since added an if statement at the top to discover if the page is not where it is supposed to be: if so log out and in again. this has solved most of my issues but I would still be very interested in my question above.

Also as a side note is there anyway to do a IF statement without an ELSE? it just seems that there may be times I would want to say:

if an error message appears > click close

with no else section needed.

thanks again

Jo

0
Joseph
Top achievements
Rank 1
answered on 10 Jun 2013, 08:28 AM

Thank you for the reply, I'm already using the test as step function for my login details, but I assumed this was only ever hit once,  which is mentioned here.

So my understanding was that if a step fails, it would only 'restart' from the top of the data sourced step, so login would never be hit again after it had been hit once?

I have since added an if statement at the top to discover if the page is not where it is supposed to be: if so log out and in again. this has solved most of my issues but I would still be very interested in my question above.

 Also as a side note is there anyway to do a IF statement without an ELSE? it just seems that there may be times I would want to say:

 if an error message appears > click close

 with no else section needed.

 thanks again

 Jo

0
Velin Koychev
Telerik team
answered on 10 Jun 2013, 03:51 PM
Hello Jo,

Yes, you can also use the approach from this link, but as you also mentioned,  you will be able to execute the login steps only once. So in your case it is a better idea to use a different approach:

In your main test put all the steps that needs to be executed many times. This will be the test that is data-driven. Your sub-test will  contain only the login steps that you don't need every time (or if you have chosen my first suggestion where you  login every time,  you  put them in another test in order to reuse these steps in the future).  

About your second question regarding the If...Else Statement. It is not a problem if you don't drag any steps to the ELSE step. This way there will be no steps in the else branch to be executed when the if condition was evaluated as false.

Looking forward to hearing from you.


Regards,
Velin Koychev
Telerik
Free summer webinars on advanced web automation tactics hosted by Jim Holmes & Adam Goucher.
Reserve your seat today!
0
Joseph
Top achievements
Rank 1
answered on 14 Jun 2013, 10:02 AM
Ok thank you, I will try your suggestions

Jo
0
Velin Koychev
Telerik team
answered on 18 Jun 2013, 02:15 PM
Hi Jo,

I hope that these approaches will help you.

I'll be happy to answer any additional follow up questions that arise.

Regards,
Velin Koychev
Telerik
Free summer webinars on advanced web automation tactics hosted by Jim Holmes & Adam Goucher.
Reserve your seat today!
Tags
General Discussions
Asked by
Joseph
Top achievements
Rank 1
Answers by
Velin Koychev
Telerik team
Joseph
Top achievements
Rank 1
Share this question
or