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

Subtest losing extracted variable

3 Answers 97 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Cheryl
Top achievements
Rank 1
Cheryl asked on 30 Apr 2012, 03:31 AM

 I have an issue where a parent test is extracting a value from its dataset and which is used in the first iteration through the subtest, but when it comes back to reuse it an error re the extracted variable not being in the store occurs.

 

What I've got is: 

 

0 – Login - extracts value A from login dataset

                1 – Do scenarios - for each record in "scenario" dataset and create NEW dataset based on information extracted from "scenario" dataset AND "extracted value A"

                                2 – run tests based on created dataset  

 

Now as each test/subtest has its own dataset, it can’t inherit from its parent BUT the first run through test #1 it uses "extracted value A" with no problem.  When it attempts to run through it again the "extracted value A" appears to have been lost as it throws an error when I'm recreating the dataset.

 

Each subtest is set as a test fragment, and they both reuse the app window.  Only the initial "0 - Login" test is set to use a new window - but that it isn't getting that far.

Hopefully I haven't confused you.

Any ideas?

Thanks

Cheryl

3 Answers, 1 is accepted

Sort by
0
Byron
Telerik team
answered on 02 May 2012, 11:08 PM
Hello Cheryl,

Thanks for trying Test Studio. I appreciate your in-depth explanation of your test. However, there are several details that are still unclear. Are you using code to set an extracted variable from a datasource? Do you switch datasources in step 2? What is the error you see after the first iteration of step 1?

It would be ideal if we could view either your test project or a sample project that mirrors its structure. Thank you very much for helping us troubleshoot your issue.

Kind regards,
Byron
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Cheryl
Top achievements
Rank 1
answered on 07 May 2012, 11:53 PM
Hi Byron

The login step and the scenarios sub step both have their OWN dataset.

During the login part, I'm extracting the value A from the login.xls dataset using code.

Then when running through the Scenarios step (which is databound to the scenarios.xls), i'm creating a new dataset to use for a further sub test , based on the scenarios.xls (currently databound) and the extracted value from the login.

What i didn't expect, was that it would go through the first iteration of the scenarios.xls - so it IS picking up the extracted value fine first time around, but fails on the second with an error:

 Exception thrown executing coded step: 'Get data'.
InnerException:
System.ArgumentException: The extracted variable 'AgentRelease' does not exist in the store. Make sure there is an extract step that has executed before executing this step.
   at ArtOfTest.Common.Design.Extensibility.ExtractionDataStore.GetValue(String name)
   at ArtOfTest.WebAii.Design.BaseWebAiiTest.GetExtractedValue(String dataBindVariableName)
   at ____Get_Scenarios.Login_to_Public_site_create_policy_via_data_CodedStep() in J:\Common Shared\Customer\CTI\Test_Master\1 - Get Scenarios.tstest.vb:line 163

Sorry, I'm not able to provide a link or project at this time.
0
Byron
Telerik team
answered on 10 May 2012, 05:55 PM
Hello Cheryl,

Based on your explanation, I attempted to reproduce the behavior you described. However, the subtest in my case was able to complete all iterations while accessing both the databound Excel spreadsheet and the extracted variable from the parent test. I used code like this to set the extracted variable in the parent test to the content of a databound Excel spreadsheet column. There may be certain complexities missing from my test, but so far I cannot reproduce the issue.

I understand that you cannot provide access to your site or your full test at this time. However, if you are able to produce a stripped-down example test that produces the same behavior against a public site, that would greatly help us address your issue. If this is not possible, please consider providing the full failure log so we can better understand the context of the error message you provided. 

Greetings,
Byron
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
Tags
General Discussions
Asked by
Cheryl
Top achievements
Rank 1
Answers by
Byron
Telerik team
Cheryl
Top achievements
Rank 1
Share this question
or