test list on silverlight, once fail causes all to fail

7 posts, 0 answers
  1. Joseph
    Joseph avatar
    21 posts
    Member since:
    May 2013

    Posted 07 Jun 2013 Link to this post

    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
  2. Velin Koychev
    Admin
    Velin Koychev avatar
    88 posts

    Posted 07 Jun 2013 Link to this post

    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!
  3. Joseph
    Joseph avatar
    21 posts
    Member since:
    May 2013

    Posted 10 Jun 2013 Link to this post

    • 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

  4. Joseph
    Joseph avatar
    21 posts
    Member since:
    May 2013

    Posted 10 Jun 2013 Link to this post

    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

  5. Velin Koychev
    Admin
    Velin Koychev avatar
    88 posts

    Posted 10 Jun 2013 Link to this post

    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!
  6. Joseph
    Joseph avatar
    21 posts
    Member since:
    May 2013

    Posted 14 Jun 2013 Link to this post

    Ok thank you, I will try your suggestions

    Jo
  7. Velin Koychev
    Admin
    Velin Koychev avatar
    88 posts

    Posted 18 Jun 2013 Link to this post

    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!
Back to Top