Multiple projects - VS 2019 how to use data

1 Answer 87 Views
VS Plugin
Archana
Top achievements
Rank 1
Archana asked on 02 Jun 2021, 03:34 PM

hi,

I need to use runtime data in excel and nees to pass the same between multiple projects.Now im able to execute the file with hard code inputs.

1 Answer, 1 is accepted

Sort by
0
Elena
Telerik team
answered on 07 Jun 2021, 08:32 AM

Hi Archana,

As far as I understand you would like to data drive the tests in your project using data from an Excel file. If this so, you will need to add this Excel file into the project, then choose the test to bind to the Excel and use the data from the file to pass it to the steps in the test. 

Once an Excel file is added to the Test Studio project. you can bind multiple tests to use the data in it - one test can be bound to one data source at a time. The Excel file can be added in multiple projects by following the same steps listed above for each project. 

Please, keep in mind that the Excel file you are adding to the Test Studio project is being copied in the Data sub-folder and is being used from this location. That said, if you need to apply any changes in the file, you need to modify these in the file from that project location. 

I hope that this information will be helpful for you. In case you need further details, please, get back to me.

Regards,
Elena
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Test Studio course! Check it out at https://learn.telerik.com/.
Archana
Top achievements
Rank 1
commented on 07 Jun 2021, 09:41 AM

Hi Elena,

i am using VS plugin - 2019 version, I am using data drive the tests in your project using data from an Excel file within one project. Now I want to pass the data from one project to another project where this excel file will be binded with one project only.

For example:
Case 1:
I have 2 projects - Project 1 and Project 2
In that I have a excel file binded with Project 1 - It has a values in excel * this excel values will be the input for both Project 1 and Project 2.
Now I want to use the values available in Project 1 in Project 2

case 2:
I have excel file input values mapped with Project 2.If I run the project 2 separately with Data["URL"].ToString() then it is working
Now I want to run project 2 by executing Project 1 - > In this case if I have below detail only data taken ("www.sampleurl.com"); but I want to execute with data from excel.
If I try then null exception only displayed.

Kindly support me to resolve this issue.
Elena
Telerik team
commented on 10 Jun 2021, 07:33 AM

Hi Archana, 

As far as I understand you need to change the data file dynamically before running the tests from any of the projects. If this is so, then you can build a custom execution extension - this is the Test Studio model for extensibility of the test execution. 

One of the methods available in this extension is the OnInitilizeDataSource, in which you can switch the data source dynamically before each test run. Please, find an example for such scenario here

Please, take the time to explore this option and let me know if it suits your needs.

Regards,
Elena

Tags
VS Plugin
Asked by
Archana
Top achievements
Rank 1
Answers by
Elena
Telerik team
Share this question
or