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

SetExtractedValue

2 Answers 178 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Nigel
Top achievements
Rank 2
Nigel asked on 18 Jul 2012, 01:26 PM
Hi All,

I understand how SetExtractedValue and GetExtractedValue work, but I would like to know if it is possible to create a SetExtractedValue in VB Code Behind without first creating a GetExtractedValue in the main script.  For Instance.

I could create a line in the test script such as this:
   Extract input 'DesignRequiredUKText' value into DataBindVariable $(DayNum).
In the Code Behind I could then have something like:
   colValue = TryCast(DirectCast(inputSheet.Cells(rowNum, colNum), Microsoft.Office.Interop.Excel.Range).Text, String)
   SetExtractedValue("DayNum", colValue)
and everything works fine.

However, could I execute the SetExtractedValue line in the Code Behind window without first having created the DataBindVariable in the test script? And then could I still use the "DayNum" variable later in the test script?  If so, would I still use it via the data driven binding $(DayNum)?

Hope the question makes sense!

Thanks,
Nigel Edwards, Transition Computing.


2 Answers, 1 is accepted

Sort by
0
Accepted
Anthony
Telerik team
answered on 18 Jul 2012, 03:06 PM
Hello Nigel,

Yes, you can create a new extracted value independently and from scratch. It is not dependent on any other extractions or data binding in the test.

Add a coded step to the beginning of the test that contains:

SetExtractedValue("var1", "Telerik")

And data bind that variable to any subsequent input or verification step the normal way:

$(var1)


Greetings,
Anthony
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Nigel
Top achievements
Rank 2
answered on 18 Jul 2012, 03:11 PM
Many thanks, Anthony.  :)
Tags
General Discussions
Asked by
Nigel
Top achievements
Rank 2
Answers by
Anthony
Telerik team
Nigel
Top achievements
Rank 2
Share this question
or