How to get text even if the UI element differs

Hello All,

I’m working on Assignment 2 of AdvanceTraning. I need to get a Confirmation ID from the Pop-Up window. How to get the text even if the UI Element differs. I get 2 types of the pop-up which are attached.pop-up2 Pop-Up1

Try to play around with the selector to see if any match both, trying to use the selector directly on the text might work, and then change the id with ‘*’. :slight_smile:

Else using a element exist to know what going on in the screen and then having both the option in the code would be a solution also. :slight_smile:

using the parallel activity, take both selectors

Hi @NancyThomas,

You can use RegeX or you can use IndexOF and a substring but first get the text of the pop-up.

isPosition = YourStringVariable.IndexOf(“is”) + 2

now you have the position of the word is within the text and we added 2 because is is a 2 word char and we just want the code. Now just get the text using a substring

code = YourStringVariable.Substring(isPosition)

Check my attached sample:
Main.xaml (5.6 KB)

If you have selector problems and it’s not detecting it also try to disable the aaname and my your selector more dinamic. You can also use the repair selector option and sometimes you automatically get a good selector by using it.


What i did before for same issue, is to use try catch, catch on the first popup, on the exception the second popup.

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