简体   繁体   中英

Automated Testing of Component Handlers in 3rd Party Javascript

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!

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);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM