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

2 posts, 0 answers
  1. James
    James avatar
    5 posts
    Member since:
    Oct 2013

    Posted 18 Feb 2014 Link to this post

    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,



  2. Cody
    Admin
    Cody avatar
    3360 posts

    Posted 21 Feb 2014 Link to this post

    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
Back to Top