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:
- Does action A work logged on as administrator
- Does action B work logged on as user A
- 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.