GDATASoftwareAG / robotframework-flaui

Windows user interface automation library for Robot-Framework. FlaUILibrary is a wrapper for the FlaUI automation library.
MIT License
58 stars 12 forks source link

Select Treeitem name colliding with -> operator #167

Closed JonasBeiTXS closed 5 months ago

JonasBeiTXS commented 6 months ago

We are trying to access a tree item that is named something like this: text - (text - text) <-> (text -text)

Our following code

FlaUILibrary.Select Treeitem
    ...    identifier=//Tree[@AutomationId="treeView"]
    ...    item=N:text1 - (text2 - text3) <-> (text4 -text5)->N:text6: text7 - ${variable}

throws this error

FlaUiError: Name 'text1 - (text2 - text3) <' could not be found in element

Apparently a part of the name of our treeitem is interpreted as the -> operator. Is there any way around this? Can -> be escaped?

ghost commented 6 months ago

Hi, @Nepitwin

it seems like change the split sep in location explanation would be a cheap solution.

image

noubar commented 6 months ago

Better solution would be to To make the keyword except either robot Array @{var} or string Example: Select TreeItem ${XPATH_TREE} N:Lvl1 a->I:1->N:Lvl3 a OR @{var} Create List N:Lvl1 a I:1 N:Lvl3 a Select TreeItem ${XPATH_TREE} ${var}

Nepitwin commented 6 months ago

All solutions are fine. I would to suggest for an easier handling an seperator parameter to change if this behavior happens.

Default seperator will be "->" but can be changed to all other type of seperators like " -> " or "\" to make workarounds about this type of issues.

Change all of treeitems in a list is asweel a potential fix to support it as seperate keyword.

I would suggest to implement the change of seperator first and if it's done then it's fine if not afterwards the array solutions.