How to put a wildcard between 2 variables to find text

Hello,

i want to find an element in a screen. This element is the addition of 2 variables (type string) and a wildcard between the 2 variables because there is other text.

I’ve tried this : var1 + “*” + var2 in a “Click Text” activity but it doesn’t work.

Do you have an idea of how to do this ?

Thank you

Hi,

To my knowledge u need not give + sign. var1 * var2 can be given

Hi @francois.tresmontan

If i put var1 * var2, i have an error in the expression editor

grafik

@francois.tresmontan

WildCard=System.Text.RegularExpressions.Regex.Match(StrText,var1 + ".*" + var2).Value

Please Pass this wildcard variable

It doesn’t work like this.
Click text activity says Text not found

No, we recommend to separate on what is code and what is failing. When something is failing then tell the details.

Maybe the selector, constructed by using the variables is not matching and catching the element. Then analyze it within the UiExplorer and share with us the details, if further assistance is needed

Hi @francois.tresmontan

You can modify the selectors as below how I passed for aaname attribute, check the below image,

Check the below workflow, it was clicking properly on the same element what I have given in the Variables,

Hope it helps!!

I think my problem is in the selector.
I only can select this :
image

It’a a very old application …

@francois.tresmontan

WildCard=System.Text.RegularExpressions.Regex.Match(StrText,var1 + ".*" + var2).Value

Please try this

I have tried but i can’t get “StrText” because of my selector

Okay @francois.tresmontan

→ When you are indicating the Target Ui element indicate the Min 2 anchors to the Ui element which are closer to the Target.
→ After indicating the Ui element check the strict selector and uncheck the fuzzy, image and computer vision in the selector options window.
→ Open the Ui explorer of Strict selector for Target and select the attributes which are reliable to selector and uncheck the unwanted attributes.
→ Come back to Studio open the properties of click activity and open the Ui explorer again for Strict selector then pass the variables to the attribute how I did in the above post.

Hope you understand!!

This will search for what OP requires in a text from string variable StrRext, not in an application.

Can you try to target element once again? With [Indicate Element] button, right to “Valider”.
If you will be able to confirm with [Highlight] (rightmost button, inactive on your screenshot) that you have desired element, the please click on Open in Ui Explorer (at the bottom) and then we will be able to examine it’s properties.

What would be var1 and var2 for this case?

Everyone thinks you’re talking about wildcards in the selector but you aren’t, you’re talking about wildcards in the Text property of the Click Text activity. I did a quick test and it looks like it does not support wildcards.

But why aren’t you working in modern? You should be able to use a regular click, with a proper selector, to click what you want.

var1 = “17:40” and var2 = “DOCTOLIB”

I want to be able to click on the line which starts by “17:40”

image

If i use only var1, i can select the line in grey in the first screen copy, but in the case where i have two which starts with “17:40”, it won’t work, mayby it won’t select the good line

I’m sorry, it(s difficult to explain and my english isn’t very good

My problem is that the selector selects a table by it’s not able to select each line of this table, in classic or modern