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

Data driven test using parameters from excel

6 Answers 156 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Saket
Top achievements
Rank 1
Saket asked on 17 Jan 2012, 06:28 AM

Hi,
 
I have written a set of test which get exceuted using webii and VSTS (C# .net). I need to implement he following in code

1. The test should be repetable : I must be able to execute the same test n number of times (where n indictaes the number of run -can be preset)
2. Diffrent input for each run: I should be able to access a excel file from which i can have the inputs that are required for running the test e.g data values.

I went through this link http://www.telerik.com/automated-testing-tools/support/documentation/user-guide/data-driven-testing/add-a-data-source.aspx#Excel  however wanted to implement the same in code.

Help appreciated...

Thanks!!
 

6 Answers, 1 is accepted

Sort by
0
Nitin
Top achievements
Rank 1
answered on 17 Jan 2012, 10:54 AM
Hi Saket

You can write Coded Step for that, I hope you Know How to Write Coded Steps

Go through the Section

http://www.telerik.com/automated-testing-tools/support/documentation/user-guide/coded_steps.aspx
Also You can access the Data Like that using Code Steps
// You can reference the column by index

Pages.Google.QText.Text = (string)Data[0];

// Or by name

Pages.Google.QText.Text = (string)Data["Numbers"];


http://www.telerik.com/automated-testing-tools/support/documentation/user-guide/data-driven-testing/local-data-driven-test.aspx

0
Cody
Telerik team
answered on 17 Jan 2012, 05:34 PM
Hello Saket,

If you are using the free Telerik Testing Framework and Visual Studio, you will need to follow their directions for creating a data driven test.

If you are using Test Studio and want to implement data driven testing in code, you can follow Nitin's directions. They are exactly right (thanks Nitin).

@Nitin, I've granted you Telerik Points for assisting.

Regards,
Cody
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Nitin
Top achievements
Rank 1
answered on 18 Jan 2012, 06:23 AM
Hello Cody
Thanks for granting Telerik Points :)

Saket, I hope this helps

Thanks
Nitin

0
Nawaz
Top achievements
Rank 1
answered on 15 Mar 2013, 11:20 AM
Hello Nithin,

    With your suggested approach. I am able to access the first row of the local data but not the second item.
    Please let me How can I access the second and all rows after using code.
    Help appreciated

Regards
Nawaz Ahnmed
0
Ivaylo
Telerik team
answered on 20 Mar 2013, 08:35 AM
Hello Nawaz,

I am sorry to hear you are experiencing this issue. This is quite strange since once you specify the column all the data in it should be used. I am not able to reproduce such a behavior. Could you please create a sample project lets say towards Google where the issue is reproduced and send it over for further investigation.

Regards,
Ivaylo
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Kavita
Top achievements
Rank 1
answered on 12 Apr 2017, 09:10 AM

Hello, 

 

I want to fetch local data of second row.

is there any way to do this better..?

See attached file for understand properly 

Tags
General Discussions
Asked by
Saket
Top achievements
Rank 1
Answers by
Nitin
Top achievements
Rank 1
Cody
Telerik team
Nawaz
Top achievements
Rank 1
Ivaylo
Telerik team
Kavita
Top achievements
Rank 1
Share this question
or