How to do data validation? can it be done using appium

Hello people

I am learning testing automation and done with the basics i want to know that if i can do data validation using appium that is if i am choosing a shipping address then can we check on the review page that the same address is been published or not can this process be automated .please mail me at [email protected]

You can use ‘assert’ to check and verify the data.

can you please provide an example or a link it will be a great help have been struggling all day

also what if i am applying a discount during payment time and i have to check whether right amount is been displayed

Its not about Appium… Its about ur test case logic and framework.

Ideally ur test script should be written such that, you pass all the test data in proper format. [Ex : Whether to apply discount, if applied what is the final price, what is the shipping address you are setting]
Once you pass these data to your test case, it can be asserted against the value shown in screen[by using Appium findElement api]

example code :

           String expectedAddressLine1 = "Test 1";
           String actualAddressLine1 = driver.findElementById("xyz").getText();

           Assert.assertTrue(expectedAddressLine1.equalsIgnoreCase(actualAddressLine1), "Address Mismatch!")

Note : I am using TestNG Assert class above.

1 Like