Con più domande
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
lunedì 30 aprile 2012 06:04
- Modificato Sandeep Raveendran lunedì 30 aprile 2012 06:12 first coloumn
Tutte le risposte
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 :)
Sandeeplunedì 30 aprile 2012 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 :
lunedì 30 aprile 2012 13:24
- Modificato TejasJ lunedì 30 aprile 2012 13: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)
Sandeeplunedì 30 aprile 2012 14: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
HTHmartedì 1 maggio 2012 10:41