Forum Discussion

mkershaw's avatar
mkershaw
New Contributor
13 years ago

If statements and Loops

Hi,



Is there a way to specify if statements in a scenario?  For example, I want to be able to only execute a particular request if the previous response contains certain data.



Also, is there a way to specify loops as well, so that I can have specific requests run multiple times?



Thanks,

Mark
  • Hi Mark, 





        "Is there a way to specify if statements in a scenario?  For example, I want to be able to only execute a particular request if the previous response contains certain data."



    No this cannot be done in LoadComplete, there is no scripting engine and or conditions within scenarios, I would love to see these implemented eventually! 





     

        "Also, is there a way to specify loops as well, so that I can have specific requests run multiple times?"



    You cannot do this either, but what you can do to have multiple same requests is to copy a single request and paste it right underneath. You can copy the amount of times you want to simulate multiple identical requests. (Not a very classy way to do things, but still better than manually recording an action 50 times in a row) 

     



    Cheers,

    Louis-Philippe

  • Anonymous's avatar
    Anonymous
    Mark and Louis-Philippe

    I have had a number of conversations with users on the subject of supporting control logic in LoadComplete.

    Granted, if we had infinite resources we probably would have had all of that and more.

    However, in my experience, there are relatively few cases when control logic is a requirement for a scenario. Clearly, if one is used to scripting the scenario to begin with, that would be the only way to go, but with the record/replay there are some options.



    First of all, for loops, please review the following topic in the online help, describing complex scenarios.

    http://support.smartbear.com/viewarticle/34449/

    You can easily do static loops using this capability, the specific case that is hard to support right now is loops with dynamic boundaries (and I suspect that is a very sophisticated case).

    We are going to publish a technical tip on this subject soon as well, it is in the second revision with tech writers.



    I'd like to understand better your need for support for if statements, to advise you better.

    Thanks for the good questions!