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
2012년 4월 30일 월요일 오전 6:04
- 편집됨 Sandeep Raveendran 2012년 4월 30일 월요일 오전 6:12 first coloumn
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 :)
Sandeep2012년 4월 30일 월요일 오전 11:26
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 :
2012년 4월 30일 월요일 오후 1:24
- 편집됨 TejasJ 2012년 4월 30일 월요일 오후 1:25
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)
Sandeep2012년 4월 30일 월요일 오후 2:22
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
HTH2012년 5월 1일 화요일 오전 10:41