Using If statements for Different Windows in Desktop application

Hello, All,

I have an issue for testing Desktop application. On one and same actions I am receiving two different named windows. My question is how can I manage to control this windows using if statements? I try to find some solutions but without success. My idea is to use if and check for specific locator. If this window contains this name, make some action else make different action. Do we have special keyword for that?

You can use Get Element for retrieving a WindowsElement object wrapping the identified window with the passed locator. Then with Should Contain or Evaluate over ${element.name} you can test what type of app you’re dealing with. And based on that, you call a specific keyword crafted by you which handles that window in the way it is expected.

More on checking substrings in strings.