say i have 10 steps in a record file and I would like to repeat step 3-7 only for a certain amount of times. Is there any easy way of doing that?
Also, is there any easy way to using different input parameter during the repeat?
how to repeat certain steps in a record file
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: how to repeat certain steps in a record file
Hi lingzhou!
Repeating is only possible via Loops(.net language) in code files but not directly in Recorder View.
If you want to use different input parameters you should look into our User Guide: Data-Driven-Testing tutorial( http://www.ranorex.com/support/user-gui ... sting.html ) which give you a good explanation how to add parameterized input functionality.
Regards,
Christian
Ranorex Support Team
Repeating is only possible via Loops(.net language) in code files but not directly in Recorder View.
If you want to use different input parameters you should look into our User Guide: Data-Driven-Testing tutorial( http://www.ranorex.com/support/user-gui ... sting.html ) which give you a good explanation how to add parameterized input functionality.
Regards,
Christian
Ranorex Support Team
-
- Posts: 25
- Joined: Tue May 05, 2015 11:25 am
Re: how to repeat certain steps in a record file
Hello,
Do you have a snipet how to loop steps programatically ?
I could not find it in the API documentation.
Thanks,
Do you have a snipet how to loop steps programatically ?
I could not find it in the API documentation.
Thanks,
Re: how to repeat certain steps in a record file
Eric,
You have two choices:
1. Move the steps to user-code, as Christian suggested, and loop over them in .NET code.
or
2. Move the steps that need to be looped into their own module and put them in a child test-case with data that will make them loop the way you want. (Test cases are essentially for-each loops that loop over each row of data in the connected data set.)
There is no automatic way to do this.
You have two choices:
1. Move the steps to user-code, as Christian suggested, and loop over them in .NET code.
or
2. Move the steps that need to be looped into their own module and put them in a child test-case with data that will make them loop the way you want. (Test cases are essentially for-each loops that loop over each row of data in the connected data set.)
There is no automatic way to do this.
Shortcuts usually aren't...
-
- Posts: 25
- Joined: Tue May 05, 2015 11:25 am
Re: how to repeat certain steps in a record file
How do you move the steps from the user code ? I cna't find how to do it in the API.krstcs wrote:Eric,
You have two choices:
1. Move the steps to user-code, as Christian suggested, and loop over them in .NET code.
or
2. Move the steps that need to be looped into their own module and put them in a child test-case with data that will make them loop the way you want. (Test cases are essentially for-each loops that loop over each row of data in the connected data set.)
There is no automatic way to do this.
Could you add an example.
Re: how to repeat certain steps in a record file
Please explain what you are trying to accomplish.
Also, I'm not sure what you mean by "move the steps from the user code", can you explain why you are moving things FROM user code?
Also, I'm not sure what you mean by "move the steps from the user code", can you explain why you are moving things FROM user code?
Shortcuts usually aren't...
-
- Posts: 25
- Joined: Tue May 05, 2015 11:25 am
Re: how to repeat certain steps in a record file
Hello,
I just want to programatically repeat certain steps.
I have a record with 10 steps and I want to repeat step 3 and 4 several times.
I reply to this topic because it was mention that it was programatically possible to repeat certain steps using .Net programming.
regards,
/Eric
I just want to programatically repeat certain steps.
I have a record with 10 steps and I want to repeat step 3 and 4 several times.
I reply to this topic because it was mention that it was programatically possible to repeat certain steps using .Net programming.
regards,
/Eric
Re: how to repeat certain steps in a record file
OK, in user-code you have to use a .NET loop of some kind. What kind of loop depends on what you want to do.
But, you still haven't fully explained what you are trying to accomplish. You say you want to loop over steps 3 and 4, but you don't say how you want to loop, or what the loop is supposed to do. We need to know what the objective of the loop is, not just that you want to loop.
So, again, please explain EXACTLY what you are trying to accomplish, not just what you want the test to look like. What task in the system-under-test makes it necessary to loop over these steps?
My guess is that you really don't want to loop in user-code, because you are, more-than-likely, trying to loop over some part of your data set, which means you need to move the actions (steps 3 and 4, and steps 5-10) into their own modules and then move them into test cases as necessary to make the loop work correctly.
EDIT: Fixed step numbers.
But, you still haven't fully explained what you are trying to accomplish. You say you want to loop over steps 3 and 4, but you don't say how you want to loop, or what the loop is supposed to do. We need to know what the objective of the loop is, not just that you want to loop.
So, again, please explain EXACTLY what you are trying to accomplish, not just what you want the test to look like. What task in the system-under-test makes it necessary to loop over these steps?
My guess is that you really don't want to loop in user-code, because you are, more-than-likely, trying to loop over some part of your data set, which means you need to move the actions (steps 3 and 4, and steps 5-10) into their own modules and then move them into test cases as necessary to make the loop work correctly.
EDIT: Fixed step numbers.
Last edited by krstcs on Mon Aug 10, 2015 8:21 pm, edited 1 time in total.
Shortcuts usually aren't...
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: how to repeat certain steps in a record file
Hello Eric,
I believe you meant to user code. You can simply multiselect the actions you want to loop on in your action table/Recording module, then right click and select Merge items to user code item:

Now you can edit the user code method just created, to add whichever looping method is appropriate for your needs.
Regards,
Bassem
I believe you meant to user code. You can simply multiselect the actions you want to loop on in your action table/Recording module, then right click and select Merge items to user code item:

Now you can edit the user code method just created, to add whichever looping method is appropriate for your needs.
Regards,
Bassem