Get/Set Extracted Variables in Code

PROBLEM

I extracted a variable in a test step. I would like to do something with that data in a coded step.

SOLUTION

Use the GetExtractedValue() function:

 

C#

object myData = GetExtractedValue("varname");

 

Visual Basic

Dim myData As Object = GetExtractedValue("varname")

 


PROBLEM

How can I set the value of an extraction variable so it can be used later in a standard action or verification step?

SOLUTION

Use the SetExtractedValue() function:

 

C#

string area = "Atlanta";
SetExtractedValue("extractedID", area);

 

Visual Basic

Dim area As String = "Atlanta"
SetExtractedValue("extractedID", area)