Monday, April 30, 2012 6:04 AM
Im using a coded ui test.Its a data driven test and I have connected excel as the data source.The excel content is given below
Now in the first iteration the value it takes will be
Second : blank value,blank value,TWO
Third : blank value,blank value,THREE
Now the requirement : The scenario force me to have only one iteration which ” takes the
First value : from first Coloumn-first row(TestUser)
Second value : Second coloumn-first row (Pswd007)
Third : Third coloumn all rows (ONE,TWO,THREE)
Ie if I use MessageBox.Show then the result should be
THREE (ie in the first iteration itself it should take all the values in the third coloumn)
Can anybody provide me the code to implement this?
Thanks in advance
- Edited by Sandeep Raveendran Monday, April 30, 2012 6:12 AM first coloumn
Monday, April 30, 2012 11:05 AM
The values that you need to fetch in same iteration should be put in single row:
Let me know if I have misunderstood anything...
Monday, April 30, 2012 11:26 AM
Sorry.I think you are mistaken and probably its my fault in explaining the scenario.
Let me explain it again.
Scenario is user logs into an application and checking some assertion in the home page.
Here when the fisrt user logs in he have 5 assertions to check.So in the first iteration the values should be
User 1 pwd001 Assertion 1 Assertion 2 Assertion 3 Assertion 4 Assertion 5
Then it moves down User 2. (Hope you understand this )
Is it possible to have a code for this logic?
Im ready to explain again still you are not able to get what im asking about :)
Monday, April 30, 2012 1:24 PM
So that means one iteration has five assertions in it and all the values to be compared are data driven, you want them to get from datasource in same iteration? : "One Iteration, Five Assertions" : Use this when single method covers multiple assertions (probably of different things) :
Or you have five iterations of same test with different assertion values and you want to share the same credentials across the iterations? : "Five Iteration, Five Assertions" : Use this when same method is executed multiple times to assert same thing with different parameters :
- Edited by TejasJ Monday, April 30, 2012 1:25 PM
Monday, April 30, 2012 2:22 PM
The first method you specified , already I had in my mind and rejected.Because its better to specify the assertion in rows(as I mentioned in the above image) than columns to make it easily understandable and to keep the excel sheet looks good(as I have a lot many assertions to add further as the project progresses to next levels.
About second method : I think it wont meet our requirement.Bcoz the user needs to be logged in just 1 time until all five assertions are verified.In the second method mentioned here,the user is tempting to log in again and again in all the iterations.
So, any other methods to make this work?
I think using Microsoft.Office.Interop.Excel can do the task.
Further more inputs on this? (codes)
Tuesday, May 01, 2012 10:41 AM
Can I recommend having one column of your data source that contains the action to be performed and start off in row 1 with launching the Application Under Test then Row 2 Login and then Row 3 some other action.
If you use a Switch Statement