Hi everyone. I have a mouse click (recording action). This mouse clicked is linked to a column of a data source. Is it possible to repeat this action a different number of times for each row of the data source while executing the data driven test. e.g
When running Row 1 - Click 3 times
When running Row 2 - Click 2 times
When running Row 2 - Click 5 times
Is this possible
Repeat action item several times in data driven testing
-
- Posts: 15
- Joined: Tue Jun 09, 2020 3:31 pm
Re: Repeat action item several times in data driven testing
Hi,
Of course, anything's possible There are two basic approaches.
Code-less way:Add the mouse click action to an individual recording/code module and insert this module to new SmartFolder. Then set the cycle count of given smartfolder to 3. Now add a condition that will run the smartfolder in case the parant data connector is at row 1. And finally, copy the smartfolder 2 times and update the count value and condition for rows 2 and 3.
Coded way:
In recording where the click is performed, convert the click to user code. Then in the user code, enclose the click in "If" condition and read the actual Row number of data connector of your choice. Then in the "If" condition, perform loop as many times as you need for each data connector row.
You can find some examples of reading data connector iteration number here:
https://www.ranorex.com/forum/viewtopic ... 27&p=50579
Of course, anything's possible There are two basic approaches.
Code-less way:Add the mouse click action to an individual recording/code module and insert this module to new SmartFolder. Then set the cycle count of given smartfolder to 3. Now add a condition that will run the smartfolder in case the parant data connector is at row 1. And finally, copy the smartfolder 2 times and update the count value and condition for rows 2 and 3.
Coded way:
In recording where the click is performed, convert the click to user code. Then in the user code, enclose the click in "If" condition and read the actual Row number of data connector of your choice. Then in the "If" condition, perform loop as many times as you need for each data connector row.
You can find some examples of reading data connector iteration number here:
https://www.ranorex.com/forum/viewtopic ... 27&p=50579
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
-
- Posts: 15
- Joined: Tue Jun 09, 2020 3:31 pm
Re: Repeat action item several times in data driven testing
Great!!. Thank you