This is a migrated thread and some comments may be shown as answers.

Test step with data iteration

7 Answers 311 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Cheryl
Top achievements
Rank 1
Cheryl asked on 08 Aug 2011, 12:26 AM
Is it possible to create a test that has a test step at the start with a data bind?

For example: I had a test that used an XLS dataset for the navigation URL at the start.  This worked successfully: it navigated to the first URL in the data, logged in and continued through the test successfully before doing the next iteration of the dataset.

I wanted to try a test step, so I made two copies of the original test - one that did the navigate and login, and one that continued on the test AFTER the login was successful.

However, the 2nd iteration fails and looking at the log it looks like it is doing the first navigate and login, then switches and does the 2nd navigate and login, then continues with the test.

How do I get it to wait to the end of the test before doing the next iteration.  Is it even possible?

Thanks in advance

7 Answers, 1 is accepted

Sort by
0
Cheryl
Top achievements
Rank 1
answered on 08 Aug 2011, 02:10 AM
Solution found: I hadn't marked the test step to be a fragment of a test, or to inherit the data from its parent.  With these both checked it now works as required.
0
Anthony
Telerik team
answered on 08 Aug 2011, 03:07 PM
Hello Cheryl,

We're glad you found a solution. Please post again if you have further questions.

Kind regards,
Anthony
the Telerik team
Vote for Telerik Test Studio at the Annual Automation Honors Voting!
0
Petr
Top achievements
Rank 1
answered on 20 Nov 2012, 06:01 PM
Hello,

I face the same problem as Cheryl. However, I`m not able to solve it. Could you please advise?

My situation is as follows. I have a test which has three test as step included. Please see attached. I have this test and also subtests data-drived. I want to be able to run the whole test in the first iteration, then in second, third, etc. However, current settings behaves differently. While executing the first step is executed and then login itself repeats as many times as it is set by data drive.

I guess it`s somewhere in settings. Please see attached another screenshot. I think it`s connected to checkboxes "IsTestFragment" or "InheritParentData". However, I haven`t been able to figure it out yet.

Thank you.

Best regards,

Petr
0
Mercedes
Top achievements
Rank 1
answered on 20 Nov 2012, 06:17 PM
Did you try enabling the "Inherit Parent Data" checkbox in the properties. The screenshot shows that it is disabled.
0
Petr
Top achievements
Rank 1
answered on 21 Nov 2012, 09:26 AM
Hey Brian,

Yeah, I tried to enable the "Inherit Parent Data" but it still doesn`t work. Can it be done just via some settings or does it have to be done by a coded step? If so, do you know how?

Thanks.

Petr
0
Petr
Top achievements
Rank 1
answered on 21 Nov 2012, 10:29 AM
Brian,

I was able to figure it out;-) I had to enable "Inherit Parent Data" and "IsTestFragmented". However, I still have some other questions. My test consists of login and then other steps where some of them are as a test step. I want to do login only once and then repeat my other steps. Is there any way how to enable repeating only steps after login? Login is always the same so I`d be losing time repeating it all the time.

Thank you.

Petr
0
Mercedes
Top achievements
Rank 1
answered on 21 Nov 2012, 12:40 PM
If you want to login once and repeat the rest of the steps, you can keep the repeating steps in a subtest and data bind the subtest.

See the screenshots for help. I have a maintest which occurs only once as it is not data bound and a sub test which is data bound and repeats based on the number of records in the databind.
Tags
General Discussions
Asked by
Cheryl
Top achievements
Rank 1
Answers by
Cheryl
Top achievements
Rank 1
Anthony
Telerik team
Petr
Top achievements
Rank 1
Mercedes
Top achievements
Rank 1
Share this question
or