Description of problem and goals
I have Robot Framework, RIDE and AutoItLibrary installed. For a simple test case, I want to open an instance of Windows Calculator, click the "7" button, keep the window open for a couple of seconds, then close the window.
The current test case is running and passing, but the "7" button does not appear to be clicked. Every step apart from clicking the button is being performed.
The current strategy being used to click the appropriate button is to do it via coordinates. Using the AutoIt finder tool, the coordinates of the "7" button were found. Unfortunately, the finder tool does not show the name or ID of controls in the Calculator Window:
It appears that the problem is due to the fact that the coordinates are relative to the entire screen, not the Calculator window. So, when an instance of this Window is opened automatically by Robot Framework, it may be a different location on the screen, so the given coordinates may not represent the location of the required button.
How can the button be reliably clicked?
Test Case Code
*** Settings ***
Library AutoItLibrary
*** Test Cases ***
TC0
# Opens the Calculator, waits until it is active, keeps it open for 2 seconds, then closes it.
Run calc.exe
Win Wait Active Calculator
ControlClick Calculator ${EMPTY} ApplicationFrameInputSinkWindow1 left 1 50 350
BuiltIn.Sleep 2s
Win Close Calculator