I don't have an official answer, but the difference is mainly in 2 things:
- continuation of the Ranorex test script
- the number of events fired
Conclusion: Click()
is closer to real user interaction, Press()
is faster and more robust as long as it is sufficient for your automation.
Regarding 1., I have observed:
Click()
immediately continues the Ranorex script execution as opposed to Press()
which waits until the code of the event handler has completed.
This can e.g. have the following impact: if a message box is opened synchronously when the button is "clicked", and you use Press()
in the Ranorex script, then you cannot answer the message box from the Ranorex script in the next step. Your test case will hang.
Regarding 2., I have observed:
Click()
:
- Paint (may occur multiple times in different order)
- MouseEnter
- MouseMove (may occur multiple times)
- MouseDown
- MouseHover
- Click
- MouseClick
- MouseUp
- MouseMove (may occur multiple times)
Press()
:
- Paint (may occur multiple times in different order)
- Click