WinAppDriver icon indicating copy to clipboard operation
WinAppDriver copied to clipboard

Mouse Right Click

Open FBorges14 opened this issue 8 years ago • 6 comments

There is no way to simulate a right button click and for some windows application it was very useful.

FBorges14 avatar Jan 19 '18 14:01 FBorges14

Hi @FBorges14,

Mouse right click or context click action is definitely useful and we have a proper example on how to do it on https://github.com/Microsoft/WinAppDriver/blob/v1.0/Tests/WebDriverAPI/Mouse.cs#L72. E.g.

session.Mouse.ContextClick(appNameTitle.Coordinates);

timotiusmargo avatar Jan 19 '18 19:01 timotiusmargo

If anybody wants to know how to do it in Ruby:

	element = $Session.find_elements(:name, "Item name")[0]
	$Session.action.context_click(element).perform()

jsbakker avatar Jan 22 '18 23:01 jsbakker

Closing ticket as issue seems to be resolved.

hassanuz avatar Jan 23 '18 23:01 hassanuz

Hi, I'd like to do ContextClick on my own coordinates since control is not possible to define by UIInspect. how could I define coordinates on my own? I need something like: session.Mouse.ContextClick(MyOwnCoordinatesDependingOnControlCoordinates);

Soloveykos avatar Jul 30 '19 08:07 Soloveykos

Hi, I'd like to do ContextClick on my own coordinates since control is not possible to define by UIInspect. how could I define coordinates on my own? I need something like: session.Mouse.ContextClick(MyOwnCoordinatesDependingOnControlCoordinates);

Try moving the mouse where you want to click based on offsets:

session.Mouse.MouseMove(session.FindElementByName("ElementName").Coordinates, 145, 391); session.Mouse.ContextClick(null);

This will Context Click with an offset of 145, 391 from the element named "ElementName".

jpalmer-miovision avatar Sep 27 '19 17:09 jpalmer-miovision

yep, offsets are the best, thanks :-)

пт, 27 сент. 2019 г. в 20:23, James Palmer [email protected]:

Hi, I'd like to do ContextClick on my own coordinates since control is not possible to define by UIInspect. how could I define coordinates on my own? I need something like: session.Mouse.ContextClick(MyOwnCoordinatesDependingOnControlCoordinates);

Try moving the mouse where you want to click based on offsets:

session.Mouse.MouseMove(session.FindElementByName("ElementName").Coordinates, 145, 391); session.Mouse.ContextClick(null);

This will Context Click with an offset of 145, 391 from the element named "ElementName".

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/microsoft/WinAppDriver/issues/343?email_source=notifications&email_token=AKER6JA4AIHUVH65SJQBANLQLY6SBA5CNFSM4EMSGQE2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7ZSEMA#issuecomment-536027696, or mute the thread https://github.com/notifications/unsubscribe-auth/AKER6JHQVGBR3W2RA2UD6ADQLY6SBANCNFSM4EMSGQEQ .

Soloveykos avatar Aug 30 '20 14:08 Soloveykos