2gis / Winium.Cruciatus

C# Framework for automated testing of Windows application based on WinFroms and WPF platforms.
Mozilla Public License 2.0
137 stars 66 forks source link

Click coordinates differs in local VM vs Azure VM where OS remains same #74

Open koder101 opened 6 years ago

koder101 commented 6 years ago

I am getting a weird issue that my 2nd click coordinates differ on different machines. Common Details:

Case 1: When running the utility in my local VM, it runs fine and the output snippet is-

Waiting for 5 seconds Window Found : XYZ - Installation Wizard FindElementByUid found : buttonInstallConsoles [10:41:37] [Info] Click on 'type: ControlType.Button, uid: buttonInstallConsoles, name: PROCEED WITH INSTALL.' element at (634, 480) ClickablePoint Waiting for 10 seconds Window Found : XYZ Consoles - Installation Wizard FindElementByUid found : 92 [10:41:47] [Info] Click on 'type: ControlType.Button, uid: 92, name: Next >' element at (798, 592) ClickablePoint Waiting for 4 seconds

Case 2: When running the utility in my Azure VM, the coordinates of 2nd click action (uid: 92, name: Next >) changes -

Waiting for 5 seconds Window Found : XYZ - Installation Wizard FindElementByUid found : buttonInstallConsoles [18:48:28] [Info] Click on 'type: ControlType.Button, uid: buttonInstallConsoles, name: PROCEED WITH INSTALL.' element at (674, 499) ClickablePoint Waiting for 21 seconds Window Found : XYZ - Installation Wizard FindElementByUid found : 92 [18:48:50] [Info] Click on 'type: ControlType.Button, uid: 92, name: Next >' element at (1258, 925) ClickablePoint Waiting for 4 seconds

Due to this my further clicks are not happening and getting null reference exception. Though the output seems it has clicked, but the click is not happening on the button and it is clicking outside the application window due to which the actual window loses focus.

I have no clue why I am getting this issue. I am using FindElementByUid() but I have also tried FindElementByName()

vinuthamikkilineni commented 6 years ago

On reason might be because the screen Resolution of your VM and in your local machine is different . I mean different DPI