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

Pass a value to a Test As Step from parent/calling test?

3 Answers 40 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Nick
Top achievements
Rank 1
Nick asked on 24 Feb 2014, 05:22 PM
I need to pass a different value to a Test As Step every time it is called.  Is there a way to do this without using a datasource?

Example calling test:
1. Type 'user01' into UserNameTextbox
2. Type 'pw01' into PasswordTextbox
3. LeftClick on LoginButton
4. Execute test 'Search'

Example Test as Step 'Search'
1. LeftClick on SearchRadioButton
2. Type <desiredValue> into SearchTextBox

In Step 4 of the parent test, I want to pass a different value to the typed value in Step 2 in the Test as Step so that I can reuse this 'Search' test for more then just a very specific search scenario.  Is this possible?  I don't want to have to connect this particular test to a datasource as I want to be able to do everything from the parent test.

3 Answers, 1 is accepted

Sort by
0
Konstantin Petkov
Telerik team
answered on 26 Feb 2014, 01:22 PM
Hi,

This really sounds like a data-driven scenario, which you can accomplish by passing the parent data source to the child test via the InheritParentDataSource test property. Other than that you can use the data extraction, basically save a value during test run to consume in the child test as well. See this article for example.

Regards,
Konstantin Petkov
Telerik
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Nick
Top achievements
Rank 1
answered on 26 Feb 2014, 06:29 PM
Thank you for the reply, Konstantin.

I'm not sure a datadriven approach is suitable for this scenario.  We want to be able to reuse the example "Execute test 'Search'" Test multiple times within a single test run, with different data each time "Search" is called.  To do this in the same test would require multiple rows in the "Search" column of the data source.  I believe each row is handled as a separate iteration and is not what we are attempting to do in this situation because our desired test occurs in a single iteration.

1. Type 'user01' into UserNameTextbox
2. Type 'pw01' into PasswordTextbox
3. LeftClick on LoginButton
4. Execute test 'Search'
5. Execute test 'Verify Results'
6. Execute test 'Search'
7. Execute test 'Verify Results'
8. Execute test 'Search'
9. Execute test 'Verify Results'

Is it possible, given the above test, to bind ColumnA to the search test, and have values "search1", "search2" and "search3" be executed at steps 4,6 and 8?
0
Konstantin Petkov
Telerik team
answered on 26 Feb 2014, 07:32 PM
Hello Nick,

You are absolutely correct about data rows driving the test execution in iteration for each row. That scenario doesn't seem to be suitable for a data-driven approach. Please give the value extraction a try instead.

Regards,
Konstantin Petkov
Telerik
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
Nick
Top achievements
Rank 1
Answers by
Konstantin Petkov
Telerik team
Nick
Top achievements
Rank 1
Share this question
or