Package com.gargoylesoftware.htmlunit.html

Examples of com.gargoylesoftware.htmlunit.html.HtmlAnchor.click()


        login(wc);
        HtmlPage page = wc.getPage(url("/cards/Cards.action"));
        HtmlDivision cardDetailsDiv = page.getHtmlElementById("cardDetails");

        HtmlAnchor createCardLink = getFirstLinkByText(cardDetailsDiv, "Create a new card");
        HtmlPage createCardPage = createCardLink.click();
        testTitle(createCardPage, "Create a card");
        assertNotNull(createCardPage.getHtmlElementById("createCardForm"));
    }
}
View Full Code Here


    private HtmlPage goToDeletePage(WebClient wc) throws Exception {
        login(wc);
        HtmlPage page = wc.getPage(url("/cards/Cards.action"));
        HtmlAnchor deleteLink = getFirstLinkByTitle(page.getHtmlElementById("cards"), "Delete card");
        return deleteLink.click();
    }
}
View Full Code Here

    public void testMenuBarLinks() throws Exception {
        WebClient wc = startWebClient();
        login(wc);
        HtmlPage page = wc.getPage(url("/"));
        HtmlAnchor cardsLink = getMenuLink(page, "Cards");
        HtmlPage cardsPage = cardsLink.click();
        testTitle(cardsPage, "Cards");

        HtmlAnchor toolsLink = getMenuLink(page, "Tools");
        HtmlPage toolsPage = toolsLink.click();
        testTitle(toolsPage, "Tools");
View Full Code Here

        HtmlAnchor cardsLink = getMenuLink(page, "Cards");
        HtmlPage cardsPage = cardsLink.click();
        testTitle(cardsPage, "Cards");

        HtmlAnchor toolsLink = getMenuLink(page, "Tools");
        HtmlPage toolsPage = toolsLink.click();
        testTitle(toolsPage, "Tools");

        HtmlAnchor accountLink = getMenuLink(page, "Account");
        HtmlPage accountPage = accountLink.click();
        testTitle(accountPage, "Account");
View Full Code Here

        HtmlAnchor toolsLink = getMenuLink(page, "Tools");
        HtmlPage toolsPage = toolsLink.click();
        testTitle(toolsPage, "Tools");

        HtmlAnchor accountLink = getMenuLink(page, "Account");
        HtmlPage accountPage = accountLink.click();
        testTitle(accountPage, "Account");

        HtmlAnchor logoutLink = getMenuLink(page, "Log out");
        HtmlPage indexPage = logoutLink.click();
        testTitle(indexPage, "Remembers your passwords");
View Full Code Here

        HtmlAnchor accountLink = getMenuLink(page, "Account");
        HtmlPage accountPage = accountLink.click();
        testTitle(accountPage, "Account");

        HtmlAnchor logoutLink = getMenuLink(page, "Log out");
        HtmlPage indexPage = logoutLink.click();
        testTitle(indexPage, "Remembers your passwords");
        // try to re-click on the cards link : the login page should be displayed
        HtmlPage loginPage = cardsLink.click();
        testTitle(loginPage, "Log in");
    }
View Full Code Here

        wc = startWebClient();
        // second login : welcome back message
        page = login(wc);
        HtmlAnchor loginHistoryLink =
            getFirstLinkByText(page.getHtmlElementById("messages"), "login history");
        page = loginHistoryLink.click();
        testTitle(page, "Login history");
    }
}
View Full Code Here

        final HtmlPasswordInput password = form.getInputByName("password");
        password.setValueAttribute("a1z2e3r4!$");
        final HtmlSubmitInput submit = form.getInputByName("_eventId_submit");
        final HtmlPage confirmPage = submit.click();
        final HtmlAnchor anchor = (HtmlAnchor) confirmPage.getElementById("continueButtonLink");
        final HtmlPage confirmPage2 = anchor.click();
        final String content = confirmPage2.asXml();
        final String url = StringUtils.substringBetween(content, "redirectUrl = \"", "\";");
        final HtmlPage callbackPage = webClient.getPage(url);
        final String callbackUrl = callbackPage.getUrl().toString();
        logger.debug("callbackUrl : {}", callbackUrl);
View Full Code Here

        FrameWindow menuFrame = page.getFrameByName("fixed");
        HtmlPage menuPage = (HtmlPage)menuFrame.getEnclosedPage();

        //basic content
        HtmlAnchor adhocAnchor = menuPage.getAnchorByHref("./indexAdhoc.jsp");
        HtmlPage adhocPage = (HtmlPage)adhocAnchor.click();
        String adhocText = adhocPage.asText();
        //System.out.println("adhoc html-->\n" + adhocText);
        assertTrue(-1 != adhocText.indexOf("Adhoc SQL Query"));//heading
        assertTrue(-1 != adhocText.indexOf("ExecuteQuery"));//button text
View Full Code Here

        FrameWindow menuFrame = page.getFrameByName("fixed");
        HtmlPage menuPage = (HtmlPage)menuFrame.getEnclosedPage();

        //basic content
        HtmlAnchor commandAnchor = menuPage.getAnchorByHref("./indexCommand.jsp");
        HtmlPage commandPage = (HtmlPage)commandAnchor.click();
        String commandText = commandPage.asText();
        //System.out.println("command html-->\n" + commandText);
        assertTrue(-1 != commandText.indexOf("DAS Command:"));//heading
        assertTrue(-1 != commandText.indexOf("ExecuteCommand"));//button text
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.