Extract values from coded step/code behind

3 posts, 0 answers
  1. Austin
    Austin avatar
    14 posts
    Member since:
    Sep 2015

    Posted 28 Feb Link to this post

    I want to set a databind variable through the coded step so that it can be repurposed and used in the test case front end.  I've tried the following:

    SetExtractedValue("extractedVarName", localVar.ToString());

    and tried calling the extractedVarName in a recorded Verify step however it doesn't seem to be valid and fails.

    Any help would be greatly appreciated.

     

    Thank you.

  2. Nikolay Petrov
    Admin
    Nikolay Petrov avatar
    308 posts

    Posted 02 Mar Link to this post

    Hi Austin,

    I managed to create sample scenario using the latest version of the product (2018.1.130). Please, note that you have to type explicitly the name of the extracted in coded steps variable when using it in a verification step. I attached a screenshot for a reference.
    The code in the codes step is the following:
    string localVar = "OPA!!!";
    this.SetExtractedValue("extractedVarName", localVar.ToString());

    I hope this information is helpful.

    Best Regards,
    Nikolay Petrov
    Progress Telerik
     
    The New Release of Telerik Test Studio Is Here! Download, install,
    and send us your feedback!
  3. Austin
    Austin avatar
    14 posts
    Member since:
    Sep 2015

    Posted 05 Mar in reply to Nikolay Petrov Link to this post

    Hi Nikolay:

    Thank you for getting back to me.

    I will try this out, thanks for also identifying that I have to manually type out the binding name that was called and that it would not be available in a dropdown.

     

Back to Top