Check if text in an element exists - do X if exists, do Y if it doesn't

Hi!

I’m trying to create a robot that will check if the text “NET ONLY” exists in an element I’ve captured then if it does, it will do X then if it doesn’t exists, it will do Y.

What I’ve thought of so far is to convert the click text activity to a string and then in the IF activity, I will use “{string}.Contains(NET ONLY)” and put a sequence below the then and else but I don’t know how to do that exactly.

Kindly check the picture below for reference. Thank you.

image

Hi,

I think it might be better to use either of the following.

  1. Use GetText (or GetFullText, Get VisibleText), then check its contents.

  1. Use ElementExists with aaname or innertext attibute like '*NET ONLY*' in the selector.

Regards,

1 Like

I tried the second way but it says it can’t be found. I’m trying to search the “NET ONLY” keyword in MS Access application and this is the following in UI Explorer:

" SyntaxEditor Code Snippet

"

Hi,

It might be necessary to use GetVisibleText (or ScreenScrpaping wizard - Native mode)if you use classic mode. For now, can you try this?

Regards,

thanks will try this but logically ur first answer works, thank u again!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.