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

Verification Steps

1 Answer 131 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Lynsey
Top achievements
Rank 1
Lynsey asked on 16 Sep 2011, 10:57 AM
Hi,

I have a test where I want to verify that a certain document ID is routed correctly on the system I am testing.  However, the document ID is generated as part of an earlier test step & changes each time a new document is created.  So each time I run the test the document ID is different & I don't know what the ID will be until it is generated as part of the previous step.  Is it possible for me to capture the document ID when it is created and use that information it in a later verification step? 

The only way I could think of to test this would be to set up a separate test to create the document ID then another test for the verification and update the verification test each time once I know the document ID that has been generated.

Thanks

1 Answer, 1 is accepted

Sort by
0
Stoich
Telerik team
answered on 16 Sep 2011, 02:10 PM
Hello Lynsey,
   it sounds like you need a Extraction step:
http://tv.telerik.com/watch/automated-testing-tools/using-element-extraction-variables-webui-test-studio
http://www.telerik.com/automated-testing-tools/support/documentation/user-guide/verifications/data-bind-an-extraction-step.aspx

It's aslo possible to access one test's Extracted Values from a different test, should you need to. This requires a little trick, you can do it by using the TestAsStep feature:

http://www.telerik.com/automated-testing-tools/support/documentation/user-guide/add-custom-step/test-as-step.aspx

What you can do is set the TestAsStep to inherit its parent's datasource (screenshot 1). That way the TestAsStep will be able to access the DataSource and the extracted values of its parent test. You can set/get extracted values in code like so:

this.SetExtractedValue("ev", "some value");

this.GetExtractedValue("ev");

So you can set a parameter in the Parent test and extract it in the TestAsStep. However, you'll need to databind the Parent test in order to use InheritParentDataSource (even if you don't plan to use the values from the datasource at all):
http://www.telerik.com/automated-testing-tools/support/documentation/user-guide/data-driven-testing/add-a-data-source.aspx

Keep in mind that if you have more than one row in the datasource that means your test will execute in multiple iterations. Let me know whether you require additional assistance with this.

Greetings,
Stoich
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
Lynsey
Top achievements
Rank 1
Answers by
Stoich
Telerik team
Share this question
or