Automating the GUI vs DB

I’m automating a search functionality based on some filters. It gave 1000 results. From scripting point of view, should I be checking the results in WebTable row by row to check if the filter check is right or not? or should I just check if there is some data/rows in the webtable and pass the test case?

Add Comment
2 Answer(s)

Swastik,

Thats a really nice and very important question. The are many reason why you should automate row by row instead of just verifying one item.

If you check just some rows you may not be able to catch loop constructs related bug. Lets see it with example, lets say  you want to print from 0 to 100.

You will write this for loop


for(int i = 0; i <= 100 ; i++)

{

System.out.println(i);

}

but in a hurry you did this


for(int i = 0; i < 100 ; i++)

{

System.out.println(i);

}

check the difference and see for yourself the two results.

Plus there may be many reasons that while coding the application the developer actually assigned wrong values to the different results for a search query. So checking row by row makes more sense.

Also, when you say DB VS GUI, I think you want to go for GUI. The reason is that DB will get you bugs in the Database related layers of application, it wont  give you bugs in the GUI code layers of your application.

Virender

Virender Singh Professor Answered on March 30, 2015.
Add Comment

Yes, GUI verification is necessary but from DB u can check below test case

DB.query.no of rows = UI.Filter.no of rows

Here u need to make sure db query should be written by you. You should not use same query which is written by developer to show results as it will always pass.

One more suggestion if u can execute multiple column query in db then u can verify that

String from DB (DB.query.row1,col1) = String from UI(UI.Filter.rows1,col1)
and so on

DB.query.row1,col2 = UI.Filter.rows1,col2
DB.query.row1,col3 = UI.Filter.rows1,col3
DB.query.row1,col4 = UI.Filter.rows1,col4

 

amitjain Supporter Answered on March 31, 2015.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.