How do I check for exact text on a webpage

I am trying to verify text that appears in a pop up to make sure that the correct text is displayed. I have used Text Exists activity and placed the text I want to check in the ‘text must be quoted’ field of that activity. However the test seems to continue even if the text I place in the activity is different to that in the pop up. How do I check that the text matches exactly and if it doesn’t for the test to stop?

Hai @juty2005… Did u try with click activity to pop up window?

Yes I used click activity on an information ‘i’ icon which opens a pop up containing the text I want to verify

Is there a certain click activity I need to use on the actual pop up to verify the text?

@juty2005… I didn’t get understand… Click is used to click particular text like pop-up window… Such as open,close ,ok

Yes so I used click initially to open up the pop up which contains the text that I want to verify. So I’m not sure what activity to use to verify that text in the pop up is correct as when I use text exists it doesn’t seem to verify that the text is exactly what I have specified. So I need a way to look at the text in the pop up and check that it matches whatever text I specify.

Haii @juty2005
Use text exists activity that returns only Boolean value.

Sorry quite new to all this and still learning, I added a variable to the text exists activity output and then made that variable boolean. This is then used in an if condition but that still doesn’t seem to return the required result. Is that the correct way to go about it?


Refer this
1 Like

Thanks. I followed this method and even though the text I have added to the target text of ‘Text exists’ activity matches what is shown in the pop up, I still get a result returned of false. I tried it in IE too as it says sometimes chrome has issues but still get false result.

use get text activity and use in IF condition yourVar.Contains(“keyWord”)
@juty2005

Hi, this gives me an error to say it’s not a member of Boolean when I try to run the test

can we see the screen shot of what you are trying to do?
@juty2005

image

@juty2005

  1. Activitiy: Get text: select the string you want to investigate. And return the output to a string variable
  2. Activity: IF : you want to search for a certain keyword or string in the output you got from step 1. So it should look like this
    variable.Contains(“the-string-or-keyword-you-want-to-check”).

in the example below

  1. I open a browser and refer to this page.
  2. i use the get text activity to select your first post

I am trying to verify text that appears in a pop up to make sure that the correct text is displayed. I have used Text Exists activity and placed the text I want to check in the ‘text must be quoted’ field of that activity. However the test seems to continue even if the text I place in the activity is different to that in the pop up. How do I check that the text matches exactly and if it doesn’t for the test to stop?

and return that to an output variable
3. in the if statement i check the output if it contains the keyword “However”.
4. if its found or not i show the result in a message box.

There are multiple ways to get or check text values. This is just one of them.
I added an example so you can reproduce what i did.
We all had to start somewhere. Just keep trying. I would advise you to go to https://academy.uipath.com there are plenty of free courses from which you can learn these things.

Main.xaml (7.6 KB)

edit: updated screenshot:

1 Like