WatiN - How to simulate contextmenu or right click using o2 watin IE 11?

35 views
Skip to first unread message

rahoolm

unread,
Sep 4, 2014, 2:55:41 PM9/4/14
to o2-pl...@owasp.org
Hi Dinis,

As per your reply to my comment on your blog, I am just reminding you about the issue I am facing with WatiN and IE 11.

I am trying to perform Right Click or trigger contexmenu or say simulate right in my WatiN script.
I nowhere found a good and working example. I tried to use jQuery trigger but was not able to achieve what I wanted.
FireEvent with oncontextmenu or contextmenu or mousedown with button 2 are not working the element is just highlighted and nothing happens.
For Drag and Drop, I was able to follow what you have mentioned.
What I personally think is that first we need to find whether that particular element is having that event or not.
I don't know how it is implemented in Selenium WebDriver, first action is created n then performed.
I also tried finding element position on screen and then using user32 mousedown n mouseup event, but without success as it clicks at random positions.
Could you please help with some working examples on IE 11?

Thanks in advance!

Dinis Cruz

unread,
Sep 4, 2014, 6:35:22 PM9/4/14
to O2 Platform
Hi, I just posted an answer to the way to do this using Windows UI Automation at https://github.com/o2platform/FluentSharp_Fork.WatiN/issues/10 . Specially the last code sample,  can you use that technique to solve your problem? Btw, you can actually get direct references using windows UI automation to a number of controls inside a web browser (like links, buttons, textBoxes, etc...). So it is possible to write a really solid UI tests this way (using WatiN/WebBrowser-control and the White API) 

If you want to do this more natively, or via Javascript, can you post an simple HTML page with a variation of your current code and events you want to trigger?

Dinis


--
You received this message because you are subscribed to the Google Groups "O2 Platform" group.
To post to this group, send email to o2-pl...@owasp.org.
Visit this group at http://groups.google.com/a/owasp.org/group/o2-platform/.

Dinis Cruz

unread,
Dec 1, 2014, 11:27:45 PM12/1/14
to O2 Platform, rahul...@gmail.com
H Rahul, where you able to find a solution for your issue?

Are you still using Watin? or have you decided to give Selenium a go? (if so, my latests published tool might help Node-Webkit REPL with support for Chrome's WebDriver)
Reply all
Reply to author
Forward
0 new messages