WinAppDriver icon indicating copy to clipboard operation
WinAppDriver copied to clipboard

Issue with clicking on element

Open rburtnykx opened this issue 6 years ago • 4 comments

Hi. I have found an issue when winappdriver click at the very top of button, and button remains not clicked.

Here what i tried to log public override void Click() { var point = GetAttribute("ClickablePoint"); var rect = GetAttribute("BoundingRectangle"); var name = GetAttribute("Name"); var classname = GetAttribute("ClassName"); Console.WriteLine("rectangle: {0}, click point: {1}, {2}({3})", rect, point, classname, name); .... }

And some output: Line 88: 00:07:47 rectangle: Left:279 Top:227 Width:13 Height:13, click point: 285,233, CheckBox() Line 89: 00:07:47 rectangle: Left:694 Top:**53** Width:87 Height:66, click point: 737,**54**, RibbonButton(Delete Selected Source Record(s)) Line 92: 00:07:47 rectangle: Left:614 Top:**934** Width:100 Height:30, click point: 664,**935**, Button(Submit) Line 95: 00:07:47 rectangle: Left:854 Top:**543** Width:150 Height:23, click point: 929,**544**, Button(OK)

Do anyone know what can be the reason? Here i found a workaround new Actions(WrappedDriver).MoveToElement(this).Click(this).Perform();

rburtnykx avatar Nov 03 '20 22:11 rburtnykx

Can you also share what it is been shown in inspect for that button?

anunay1 avatar Nov 04 '20 16:11 anunay1

Will try to share, looks like issue is conditional. Sometimes it is able to click on it, sometimes no. While I'm trying to get attributes dump and inspect output i was able to get inspect.exe output for other one where click was failed

How found: Mouse move (389,371) hwnd=0x0000000000110410 32bit class="HwndWrapper[Shell.exe;;f2756c80-0250-455f-8210-2a1b2e3af4a4]" style=0x16C80000 ex=0x100 Name: "OK" ControlType: UIA_ButtonControlTypeId (0xC350) LocalizedControlType: "button" BoundingRectangle: {l:374 t:361 r:454 b:381} IsEnabled: true IsOffscreen: false IsKeyboardFocusable: true HasKeyboardFocus: true AcceleratorKey: "" AccessKey: "" ProcessId: 5940 RuntimeId: [7.1734.30D473E] AutomationId: "okButton" FrameworkId: "WPF" ClassName: "Button" IsControlElement: true IsContentElement: true ProviderDescription: "[pid:5940,hwnd:0x0 Main(parent link):Unidentified Provider (managed:MS.Internal.Automation.ElementProxy, PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)]" IsPassword: false ItemStatus: "" ItemType: "" IsRequiredForForm: false HelpText: "" ClickablePoint: {x:621 y:556} Orientation: 0 IsDialog: [Not supported] FillColor: [Not supported] OutlineColor: [Not supported] OutlineThickness: [Not supported] FillType: [Not supported] CenterPoint: [Not supported] Rotation: [Not supported] Size: [Not supported] VisualEffects: [Not supported] HeadingLevel: [Not supported]

rburtnykx avatar Nov 04 '20 22:11 rburtnykx

Hi @rburtnykx - is the properties same when you were able to click on button and when not. I am guessing there may be some change in button properties

varun210619 avatar Nov 06 '20 08:11 varun210619

Hi @rburtnykx - is the properties same when you were able to click on button and when not. I am guessing there may be some change in button properties

Yes, I think the same. But it looks very strange, and I'm not sure why having boundary rect sometimes it tries to click at the top. So here is button for which i was able get my log record and inspect output after few seconds.

14:38:33 rectangle: Left:9 Top:56 Width:44 Height:66, click point: 31,57, RibbonButton(Create New)

INSPECT.EXE

Name: "Create New" ControlType: UIA_ButtonControlTypeId (0xC350) LocalizedControlType: "button" BoundingRectangle: {l:9 t:56 r:53 b:122} IsEnabled: true IsOffscreen: false IsKeyboardFocusable: true HasKeyboardFocus: false AcceleratorKey: "" AccessKey: "" ProcessId: 8228 RuntimeId: [7.2024.19AE51] AutomationId: "" FrameworkId: "WPF" ClassName: "RibbonButton" IsControlElement: true IsContentElement: true ProviderDescription: "[pid:8228,hwnd:0x0 Main(parent link):Unidentified Provider (managed:MS.Internal.Automation.ElementProxy, PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)]" IsPassword: false ItemStatus: "" ItemType: "" IsRequiredForForm: false HelpText: "Create a new View" ClickablePoint: {x:47 y:133}

rburtnykx avatar Nov 06 '20 13:11 rburtnykx