Check if window element exists?
-
Hello!
First, really nice to see a good forum - it is way easier to search info compared to rocket chat!
I need to automate parts of windows application, Visma. I was wondering what the best approach is to find out if sub-window is present in the main window?
Regards
-
@b I solved this by using GetElement. I create a UiElement variable, an array, and set that to the property "Elements" of the GetElement activity. Property "MinResult" = 0, "MaxResult" = 1.
I can than check the length of the Elements variable. If it is equal to 1, I know I found the window. Since this is a native windows application, I also set the timeout of GetElement to 1000ms. Default value is 3000. If this had been a web application I would probably increase the value due to possible lag time by using internet.
Anyway, I'm not sure if this the way to do it? Any other way? Best practice? This seems pretty fast.
-
As @benny-mildh perfectly explained, you can use Get Element for that, just remember to set Min Results to 0, so it does not throw and error if it does not find the window/element