TestProject Forum

Get text dynamically and verify it matches with text on another screen

Android Mobile testing-
I want to get text dynamically and verify it matches with text on another screen

There are dates mentioned on the page which I want to capture and verify if it matches with text on another screen.
Screen looks like this:
1st-Feb
2nd-Feb
3rd-Feb
4th-Feb
This is how page looks like and there is another page which looks like this.
I want to verify these dates.
Kindly help

Hello @tanvi.lohakare,

You can get the text from these date elements, store the text in a parameter, navigate to the required screen, capture the data elements in that screen and compare their test with the parameters you saved in the previous steps.

Here is an example for you:

  • Hover the date, press double shift to capture the element, use the “Get Text” action

  • Store the output value of this action (which is the text of the date element) in a parameter for further use
    image

  • Repeat the above steps for the next 2 dates, save the output in different parameters

Then, you can navigate to the next screen, hover the required elements, press double shift to capture them, and set validation of “Contain Text”:

Insert the parameter you created in the steps above, that stores the value of the date element from the previous screen:
image

This way, you can compare elements text between screens, as the parameters value are dynamic.