From: Michael <mi...@li...> - 2008-03-17 18:05:39
|
Hi all, In a html page I have a drop down list, each element being an anchor with an onclick javascript event. Something like the following: <ul> <li> <a onclick="setStatusToPause(1); return false;" href="#">Pause</a> </li> <li> <a onclick="setStatusToRun(8); return false;" href="#">Run</a> </li> </ul> I get all anchors and click the one that sets status to pause: List<HtmlAnchor> anchors = (List<HtmlAnchor>)htmlPage.getAnchors(); for(HtmlAnchor a : anchors) { if(a.getOnClickAttribute().indexOf("setStatusToPause") != -1) { Page page = a.click(); synchronized (page) { try { page.wait(5000); } catch (InterruptedException e) { logger.warn("failed to sleep"); } } break; } } However, I verified that the javascript was never invoked. Any idea why? Thanks!! |