Verifying on screen contents by comparing DB to UI
We have 4 different environments, with each environment having multiple databases.
Each database could/will have different data, but all in the same structure
What I am trying to do is find a way (no matter what environment/database) I am using that when I am verifying the UI contents, I can directly test that against the database to make sure the tables are populating correctly. Verifying single values has not been an issue, but verifying a complete table has become difficult as I am not looking at the same database each test.
A SQL table example could be like this, and this is what I want to verify is against what is displaying on the UI.
I am not sure if I can use the Stores>DB Tables as it does not seem those can by dynamic, so I am stuck in 1 environment and 1 database. I am also not sure if I can create a new DB Table project variable that can store the query results in a format that I can compare either. Instead of recreating the wheel, I am looking for insight on if, and what others have found to be the best way to go about this.
Below is an example of what I am doing for a Single value.
Qry = ADO.CreateADOQuery();
Qry.ConnectionString = "my connection string"
Qry.SQL = "SQL Count(*) Statement"
Project.Variables.Item_Total = Qry.FieldByName("Count").value;
Log.Message('Current Item count is ' + Qry.FieldByName("Count").value);
Solved! Go to Solution.
I would do it this way (but written in your code)
For each line in the database
read the SearchItem info
for each item on the UI
add one to UICount if item = SearchItem
compare UICount to SearchItemCount to verify
If each of your databases have the same structure and the UI is the same, then this should work for any of them
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.