Error when multiple words in name property of a Windows Locator

I am using the RPA.Windows library
I am trying to change the Font Style in Spanish Notepad.

Instructions that succeed

 Click    control:Edit + name:Fuente:
 Click    control:Edit + name:Tamaño:

Instruction that errors:

 Click    control:Edit + name:Estilo de fuente:

I get a warning:
[ WARN ] Invalid locator strategy ‘fuente’! (assuming ‘name’)

And a runtime error of:
ElementNotFound: Element not found with locator ‘control:Edit + name:Estilo de fuente:’

It seems that when the name property has multiple words and finishes with a colon, then Robocorp assumes that the last word specifies a property.

In this case it warns that fuente: is an unrecognized property name

Yes, and you can use " to enclose such space-separated locators containing also reserved symbols in their name, so you won’t trick the locator strategy: control:Edit name:"Estilo de fuente:" (there’s no +, as space acts for property separator)

Let us know if that works for you.

Thanks, cosmin. It worked!

there’s no + , as space acts for property separator

It should be noted that it has to be a single space, o/w the second property will be taken as a parameter.

1 Like

Also, with the quite funky locators (containing spaces and reserved symbols), might be better to even adopt a subname: or regex: strategy instead. (sample)

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