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

Extract Values from Browser and Pass to the next test

7 Answers 432 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 21 Jul 2011, 02:05 AM
Hi Telerik,

I haven't tried it yet but is it possible that can the test studio pass the extracted values to the next test? I will just store the extracted values in the memory so no writing of values on a excel sheet.

Steps:

1. Navigate to Browser.
2. Enter Details.
3. Save.
4. Extract Values(e.g. Record Id)
5. Search for Record (This step will be a Test as Step using the extracted value as an input.)

Thanks.

7 Answers, 1 is accepted

Sort by
0
Accepted
Plamen
Telerik team
answered on 21 Jul 2011, 03:44 PM
Hi Mark,

Thank you for asking this question and I'm happy to inform you that It is possible to pass the extracted values from the parent test to your sub tests. I'm attaching a sample test to see how it works.

I also want to share with you another ability of Test Studio that you might not be aware of, and this is the ability to inherit the data source from the parent data-bound test by checking the "InheritParentDataSource" property in the test properties(see screenshot). Note that the test should be used as a sub test of a data-driven test to be able to inherit it's data info or Test Studio will fire an error.

Kind regards,
Plamen
the Telerik team
Register today for a live 'What's New in Test Studio R1 2011 SP2' event on Tuesday, July 19 at 2pm EST!

Have you looked at the new Online User Guide for Telerik Test Studio?
0
Deepeka
Top achievements
Rank 1
answered on 22 Nov 2012, 04:04 PM
Hi Telerik Team,

The example which you have shared is kinda useful to my requirement.

But with your existing example of extraction when i do databind to "ParentTest" by attaching csv file having column names Variable,Variable1,Variable2

And then run the Parent test . it do not gets executed and its do fails or any log of error is displayed.
but if i remove Databind from Parent test then it exceutes till first 3 steps.


Please let me know on this.



0
Plamen
Telerik team
answered on 23 Nov 2012, 12:32 PM
Hi Deepeka,

What exactly is your automation scenario? Please describe it in details, so we can provide you with a proper solution. The test provided in my previous post is outdated and not executable, because the Google page has changed since then, but the concept is still the same. This test demonstrates how to extract a variable in one test(parent test) and then use it in a "Test as Step".  

Keep in mind that you should not have columns in the external data source with the same names as the extracted variables.  

Regards,
Plamen
the Telerik team
Are you enjoying Test Studio? We’d appreciate your vote in the ATI automation awards.
Vote now
0
DemBones
Top achievements
Rank 1
answered on 27 Nov 2012, 09:04 AM
I have managed to get the example test working, but those bindings were already set up.  Trying to set a bind for a variable that does not exist in that particular test case does not seem to be possible for me.

The UI has changed since the documentation was written
http://www.telerik.com/automated-testing-tools/support/documentation/user-guide/knowledge-base/data-driven-testing/pass-a-variable.aspx

The dialog for binding a variable is different and doesn't allow me to set a variable that is not in the list, and the list only contains variables from the open test.
0
Plamen
Telerik team
answered on 27 Nov 2012, 12:12 PM
Hi Hamish,

Thank you for notifying us about the outdated info in the article, we'll fix that as soon as possible. In the meantime you can try the following steps:
    1. Create a project and add two tests: Parent and Child.
    2. Set the InheritParentDataSource property of the child test to True.
    3. Open the Parent test.
    4. Bind the parent test to a local or external data source.
    5. Click Record and navigate to a random word generator site.
    6. Perform an Extraction on the word.
    7. Edit the DataBindVariableName for the Extract step.
    8. Open the Child test.
    9. Record steps that navigate to www.bing.com, enter a search query, and click the submit button.
    10. Bind the variable to the Enter Text step. Simply expand the Value dropdown, enter the name of the Extracted variable and press Enter. Then click on the 'Set' button.
    11. Go to the project tab and click on the Save button.
    12. Load the Parent test again.
    13. Add the Child test to it via the Test as Step feature.
    14. Execute the Parent test.
    15. The random word is extracted in the Parent test and used as the search query in the Child test.

The following video demonstrates the whole process:
http://screencast.com/t/Fb6HQKwPYbg

The sample project is also attached. Please let me know if you need further assistance.

Regards,
Plamen
the Telerik team
Are you enjoying Test Studio? We’d appreciate your vote in the ATI automation awards.
Vote now
0
DemBones
Top achievements
Rank 1
answered on 28 Nov 2012, 02:27 AM
Ok, I finally got this working after much wasted time.

Your description for step 10 is a little inadequate, but it at least included the part I was missing.

"10. Bind the variable to the Enter Text step. Simply expand the Value dropdown, enter the name of the Extracted variable and press Enter. Then click on the 'Set' button."

You have to press enter after entering the text and before clicking on submit otherwise it doesn't work.  Not very intuitive, I would even consider this a bug.

The next thing I want to do is pass variables between child tests.  Is this possible?
0
Plamen
Telerik team
answered on 28 Nov 2012, 10:17 AM
Hello Hamish,

I agree with you completely, pressing enter to bind a property is not very intuitive. I filed a bug on this behavior. You can track its progress and vote for it here: Public URL.  

I have also updated your Telerik points for the caused inconvenience.

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