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

How to read value from an excel using data driven approach?

1 Answer 106 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
James
Top achievements
Rank 1
James asked on 19 Feb 2014, 05:31 AM
Hi,

I am working upon a WPF application, where the course of action changes depending upon the type of login account.
for e.g if we are login as on administrator, some dfferent course of action tales place. If web are loging as gatekeeper, some different action needs to be performed.
I have an excel sheet maintained for this, having roles & their cprresponding action.

Howevere, i am not able to read value from a particular cell, in an excel sheet. could you please help me out with this?
Also, i need telerik to read value row wise, as it is a data driven approach.

For eg,: if we are on 1 st row, it should read value from cell of first row.
If we areon 3rd row, it should read value from cell, of that particular row.

Thanks,



1 Answer, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 21 Feb 2014, 08:50 PM
Hello,

I am working upon a WPF application, where the course of action changes depending upon the type of login account. for e.g if we are login as on administrator, some dfferent course of action tales place.

My first reaction to this is that you may be putting too much into one test. It is better to create a different test for each test case. I'm thinking of test cases like this:
  1. Does action A work logged on as administrator
  2. Does action B work logged on as user A
  3. Is action A prohibited when logged on as user A
Each of the above should be a different test. When you try to take different actions in the test based on which user was logged on, it makes for an overly complex and difficult to maintain test. It also makes test failures difficult to interpret. A failing test could mean any number of things are broken. Lastly when the test fails the test stops. It won't test anything after the point of failure. I recommend reading this blog post about "Using Data Driving Wisely".

If instead you break it up into a number of smaller tests and put them into a test list, you run the test list and based on which tests passed and which failed you know exactly what features are working and which ones aren't.

Another problem with the approach you're trying to take is that Test Studio has no built-in feature for taking path A or path B based on the data. There is a method of getting at the data for the current row through code. Using code with an IF ELSE block is the only way to make the test follow path A or B based on the data value contained in your data source.

Let me know if I can help you further.

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