Verification Steps

2 posts, 0 answers
  1. Lynsey
    Lynsey avatar
    4 posts
    Member since:
    Jun 2011

    Posted 16 Sep 2011 Link to this post

    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
  2. Stoich
    Admin
    Stoich avatar
    1 posts

    Posted 16 Sep 2011 Link to this post

    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
Back to Top