1

次のテストを書きました。htmlunit mouseOver() 関数が機能していないようです (ポップオーバーの HTML コードが表示されません)。何か不足していますか?この問題を解決するにはどうすればよいですか?

@Test
public void test() throws Exception {
    try {

        WebClient client = new WebClient(BrowserVersion.FIREFOX_3_6);
        HtmlPage currentPage = client.getPage("http://plugins.learningjquery.com/cluetip/demo/");
        String xpath = "//a[@title='jTip Style!']";
        HtmlElement elm = (HtmlElement) currentPage.getByXPath(xpath).get(0);
        xpath = "(//img[@src='kids-drop-sand.jpg'])[1]";
        HtmlPage newPage = (HtmlPage) elm.mouseOver();
        Assert.assertTrue(newPage.getByXPath(xpath).size() > 0, "Popover is not displayed");

    } catch (Exception ex) {
        logger.error("Exception thrown in " + this.getClass().toString()
                + " " + ex.getMessage(), ex);
        throw ex;
    }
}
4

1 に答える 1

0

最新の svn で試しましたか?
http://htmlunit.sourceforge.net/gettingLatestCode.html

または、最後に成功したビルド: http://build.canoo.com/htmlunit/buildresults?log=log20120530150012Lbuild.1963

利用可能な最新リリースはかなり古く、JS イベントの管理が不十分です。

于 2012-06-01T08:48:56.503 に答える