views:

39

answers:

1

I'm currently using WebAii and WatiN to try and automate some tests of a 3rd party web product, to see if some data migration will break the web portal.

The problem I'm having is that they have used Component Handlers in their Javascript, and so invoking a Click on a web-part (SPAN, DIV etc) is not triggering the generic handler.

// WatiN example
// Find the GoTo link
Frame uiFrame = ie.Frame(Find.ById("someFrame"));
Span gotoSpan = uiFrame.Span(Find.ById("someSpan"));

gotoSpan.Click();   //Click it!

Pointers in the right direction would be much appreciated!

A: 

Found the answer. The span was only responding to a MouseUp event, instead of the click =P

//WebAii example
eElement = uiFrame.Find.ById("someSpan");
uiFrame.Actions.InvokeEvent(eElement, ScriptEventType.OnMouseUp);
Mark Glorie