Schedule Simple Test Frequently

8 posts, 0 answers
  1. Some
    Some avatar
    19 posts
    Member since:
    Mar 2009

    Posted 01 Nov 2011 Link to this post

    Hello,
    I have been asked to schedule a simple login test on our website to run every 15 minutes.  Since we are unable to repeat a test in a single schedule more often once per day and I would like to avoid setting up 96 of those schedules I am searching for alternatives.  I have been considering placing the same test in a test list 12 times with 15 minute waits between each iteration or looping through the same test multiple times with 15 minute waits between each iteration however I have been unable to determine how to do any of these options.  Do you have any suggestions?  I am working in the full version of Test Studio.

    Thanks in advance,
    Nick
  2. Cody
    Admin
    Cody avatar
    3354 posts

    Posted 01 Nov 2011 Link to this post

    Hello Some,

    There are a few possible solutions using the approach you have in mind. All of them involve using the Execution Delay test step. A 15 minute delay equates to 900,000 milliseconds, which is what the Execution Delay test step uses. With this you could:

    1) Create a data driven test, not really use the data, add a 15 minute execution delay. I would put it as the first step because if the test ever fails it won't reach the last test step thus skipping your intended 15 minute delay
    2) A test list won't really work nicely because you can't add the same test more than once to a test list.
    3) You could surround the main steps of your test in a Loop, including the Execution Delay. If the test ever runs into an error, it will step the loop and the test.  

    All the best,
    Cody
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Some
    Some avatar
    19 posts
    Member since:
    Mar 2009

    Posted 01 Nov 2011 Link to this post

    Cody,
    I have made good progress by creating a new test and inserting "Test as Step" steps with each step containing my simple login tests and 15 minute waits in between.  Now my problem is related to failure notifications.  If a failure is encountered I would like my process to continue to run additional wait / test cycles however I would also like each failed "Test as Step" to generate an email on failure.
    Not having much luck with this.  I have set my test steps to "Continue on Failure" and for the scheduled task list to email on test failure.  The problem is the failure email is not sent out as soon as a test step fails but instead goes out after the entire test list has completed.  The scenario I would like to support is for a login test to run against an environment every 15 minutes and if that login test should fail (unable to login) an email should be sent out and that test should continue to execute every 15 minutes with a failure email generated until the test begins to complete successfully. 

    Thanks,
    Nick
  4. Cody
    Admin
    Cody avatar
    3354 posts

    Posted 02 Nov 2011 Link to this post

    Hello Nick,

    What I recommend to overcome the problem of sending email on failure is to convert your verification step to code and add code to send an email when the comparison fails. In the process convert the comparison from an Assert to an ordinary If() construct.

    All the best,
    Cody
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Some
    Some avatar
    19 posts
    Member since:
    Mar 2009

    Posted 03 Nov 2011 Link to this post

    Cody,
    How do I get the status of the test?  The steps that are performing the test are from a recorded script with each of those steps set to continue on failure so that when the test ends it can hit my custom coded step.  So how do I determine if any of the preceding steps failed?  If I am going in the wrong direction feel free to correct.

    Thanks,
    Nick
  6. Cody
    Admin
    Cody avatar
    3354 posts

    Posted 03 Nov 2011 Link to this post

    Hi Some,

    That actually is a problem. Currently it is not possible, in a coded step, to get the overall pass/fail status of the entire test while the test is running. Only the OnAfterTestCompleted can get this status. But in your case I believe that is too late (except possible you could do it in a subtest which your parent test repeatedly is calling but I haven't tried this to verify it works). That function only gets called when the test is exiting.

    That's why I was recommending you perform some sort of comparison in your code and send your email based on the results of that comparison.

    Best wishes,
    Cody
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  7. Some
    Some avatar
    19 posts
    Member since:
    Mar 2009

    Posted 07 Nov 2011 Link to this post

    Only the OnAfterTestCompleted can get this status. But in your case I believe that is too late (except possible you could do it in a subtest which your parent test repeatedly is calling but I haven't tried this to verify it works).

    Cody,
    the OnAfterTestCompleted event does fire when in a subtest and is the direction I went.  That allows me to stick with a fully scripted test and just hook into this event to send an email if required.

    Thanks,
    Nick
  8. Cody
    Admin
    Cody avatar
    3354 posts

    Posted 08 Nov 2011 Link to this post

    Hello Some,

    Excellent news! We'll be here if you need further assistance. Sounds like you've got it well under control at this point.

    Best wishes,
    Cody
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top