This can be explained as a Challenging Scenario in interviews as below:
“UI-DB validation: I faced a scenario where I had to fetch the account numbers from the UI application and I had to validate that the accounts which are displayed in the UI page is matching with the corresponding data base table.”
Use existing Cucumber Frame work to do this test case. FW kept here:
https://github.com/akashdktyagi/AutomationPoCCucumber
Note: try to do this on your own using the existing framework. DB methods are already part of the framework so you have to reuse them. Some of the step defs in below feature file is already implemented, so check which step defs is not there and only implement them.
I will provide the solution in couple of days.
Feature file to be Automated.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
@parabank Feature: validate account in parabank UI matches with DB accounts table Background: Pre Requsite to open browser and sign in Given As a user when I launch application in "chrome" And navigate to url as "http://parabank.parasoft.com" When I enter user name as "john" And I enter password as "demo" And I click submit button Then I should be logged in to the application with title as "ParaBank | Accounts Overview" @parabank Scenario: validate the account When I fetch all the accounts numbers from account overview page for user "John" And I fetch Data from DB using "Select acc_number from ParaBankAccounts where customer_name ='john'" Then I validate account number in parabank matches with DB accounts table values |