Reference variable extracted in prior test

1 Answer 83 Views
Test Results
Jessica
Top achievements
Rank 1
Jessica asked on 29 Mar 2023, 05:12 PM

Hello,

I noticed in the documentation (https://docs.telerik.com/teststudio/features/recorder/highlighting-menu/quick-steps/extraction in the note at the bottom) that I could reference a variable that I binded to in a prior test if I reference the variable without the '$', clicking brackets, and clicking set. Currently the test that does the extraction runs first and then the next test that runs in the list tries to reference the variable. Yet when I run the list I get an error that says "Column name '[variable name]' does not exist!". I wasn't sure if there was a bug with that current feature or if that was no longer an option of if I needed to do it as a coded step instead. 

My current version of Test Studio is 2023.1.222.2

1 Answer, 1 is accepted

Sort by
0
Elena
Telerik team
answered on 30 Mar 2023, 02:35 PM

Hello Jessica,

The extracted variables can be reused in the context of one test. That means you can have one parent test which executes mutliple tests as steps and all variables generated from the tests in this setup can be reused in the upcoming steps of the parent test (including the rest of the tests used as steps). 

The setup that you describe is to have separate tests into a test list. Thus, when each next test starts, the execution context is reneweed and the extracted variables from the previous test are not present anymore. 

With that said you might need to rearrange the tests so that you can accomplish your scenario. Let me know if you need additional assistance with this. 

I hope this information helps you sort out your doubts. Should you have any additional questions feel free to continue the conversation.

Regards,
Elena
Progress Telerik

Virtual Classroom is the free self-paced technical training portal that gets you up to speed with Telerik and Kendo UI products including Telerik Test Studio! Check it out at https://learn.telerik.com/.
Jessica
Top achievements
Rank 1
commented on 19 Apr 2023, 09:27 PM

Hello Elena, 

My apologies on my delayed reply, I just now noticed that you replied to this. So based on the documentation (towards the bottom of the page) in the gif does the "Verification" test run first in the list and then the "Click Search + Perform Search" test is able to reference to 'DemosLink' variable work correctly? I believe this is how I am doing it in my test as well. I have the extract step in a test that is ran first and then a subsequent test run later in the list that uses the extracted variable from the previous test. I have recycle browser so it doesn't close and reload the browser after each test. Am I missing anything? We can also switch this to a support ticket if you think that's a better avenue to discuss this.

Elena
Telerik team
commented on 20 Apr 2023, 10:27 AM

Hello Jessica, 

Please, refer to this article of using tests as steps in a parent test. This is how you can extract a variable in one test and use it later in another one. 

The test list in Test Studio consists of separate tests and the extarcted variables cannot be kept between different tests. 

With that said, you will need to re-order at least some of the tests and add them as steps into one parent test - that way the variable can be reused between these.

If reoredering the tests is not an option, you can extend the current scenario by outputting the extarcted variable into an external file and then in the next test in the test list read it from that external file and use it further. You can see this sample for writing into an Excel file

I don't mind if you want to open a support ticket, but the information to provide will not differ from what is listed in this thread. However, feel free to contact us as well in a private thread. 

Regards,
Elena

Tags
Test Results
Asked by
Jessica
Top achievements
Rank 1
Answers by
Elena
Telerik team
Share this question
or