This is a migrated thread and some comments may be shown as answers.

Call context menu programatically with WatiN

0 Answers 48 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Andy
Top achievements
Rank 1
Andy asked on 10 Jan 2012, 06:23 PM
Hi,

I am writing some tests in IE around our RadTreeView using WatiN. It's great for navigating the tree and expanding nodes but I am having some trouble raising our XML defined context menus via right click.

I've tried simulating a right click using
private void ContextClick(Element span)
{
            NameValueCollection eventProps = new NameValueCollection();
            eventProps.Add("button", "2");
            span.FireEvent("onmousedown", eventProps);
}
where span is the Span DOM element that contains the relevant node name. To my mind this should simulate the user right clicking on the node. All I see happening though is that the node is highlighted yellow. Anything to do with not havign a cursor/mouse position?

I've check the client-side API and I can see a function for making the Context menu disappear but I can't find anything I can call on the page to make it appear. Is there anything like this or can anyone think of a way of simulating a right mouse click on a node using server side code?

Many thanks in advance...

No answers yet. Maybe you can help?

Tags
TreeView
Asked by
Andy
Top achievements
Rank 1
Share this question
or