Package com.gargoylesoftware.htmlunit.html

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


  
   @Test(dependsOnMethods={"homePageLoadTest"})
   public void fileUploadTest() throws IOException {
      final HtmlAnchor linkEl = (HtmlAnchor) page.getFirstByXPath(FILE_UPLOAD_LINK);
     
      final HtmlPage uploadPage = (HtmlPage) linkEl.click();
      if (uploadPage == null){
         fail("Could not read page");
      }
           
      final HtmlInput el1 = (HtmlInput) uploadPage.getFirstByXPath(FILE_UPLOAD_FILE);
View Full Code Here


  
   @Test(dependsOnMethods={"homePageLoadTest","fileUploadTest"})
   public void graphicImageTest() throws IOException {
      final HtmlAnchor linkEl = (HtmlAnchor) page.getFirstByXPath(GRAPHIC_IMAGE_LINK);
     
      final HtmlPage graphicPage = (HtmlPage) linkEl.click();
      if (graphicPage == null){
         fail("Could not read page");
      }
     
      final HtmlImage image = (HtmlImage) graphicPage.getFirstByXPath(IMAGE);
View Full Code Here

        WebClient wc = new WebClient();
        HtmlPage userPage = wc.goTo("/user/me");
        HtmlAnchor privateViewsLink = userPage.getFirstAnchorByText("My Views");
        assertNotNull("My Views link not available", privateViewsLink);

        HtmlPage privateViewsPage = (HtmlPage) privateViewsLink.click();

        Text viewLabel = (Text) privateViewsPage.getFirstByXPath("//table[@id='viewList']//td[@class='active']/text()");
        assertTrue("'All' view should be selected", viewLabel.getTextContent().contains(Hudson_ViewName()));

        View listView = new ListView("listView", hudson);
View Full Code Here

        // Now we're on that page. We should be able to find a link to the failed test in there.
        HtmlAnchor anchor = testReportPage.getFirstAnchorByText("tacoshack.meals.NachosTest.testBeanDip");
        String href = anchor.getHrefAttribute();
        System.out.println("link is : " + href);
        Page failureFromLink = anchor.click();
        assertGoodStatus(failureFromLink);

        // Now check the >>> link -- this is harder, because we can't do the javascript click handler properly
        // The summary page is just tack on /summary to the url for the test
View Full Code Here

        //clicking on an image
        assertTrue(page.getElementById("albumImage").getAttribute("src").contains("space.gif"));
        DomNodeList<HtmlElement> ele= table.getRow(3).getCell(0).getElementsByTagName("a");
        final HtmlAnchor anchor =(HtmlAnchor) ele.get(0);
        final HtmlPage page2= anchor.click();
        Thread.sleep(3000);
        //checking whether there are images in the album
        assertTrue( page2.getElementById("albumImage").getAttribute("src").contains("/photark/gallery/vegas/dsc00")); //Don't use a specific image
        //as we can get <> order in <> OS
View Full Code Here

        //clicking on an image
        assertTrue(page.getElementById("albumImage").getAttribute("src").contains("space.gif"));
        DomNodeList<HtmlElement> ele= table.getRow(3).getCell(0).getElementsByTagName("a");
        final HtmlAnchor anchor =(HtmlAnchor) ele.get(0);
        final HtmlPage page2= anchor.click();
        Thread.sleep(3000);
        //checking whether there are images in the album
        assertTrue( page2.getElementById("albumImage").getAttribute("src").contains("/photark/gallery/vegas/dsc00")); //Don't use a specific image
        //as we can get <> order in <> OS
View Full Code Here

        //clicking on an image
        assertTrue(page.getElementById("albumImage").getAttribute("src").contains("space.gif"));
        DomNodeList<HtmlElement> ele= table.getRow(3).getCell(0).getElementsByTagName("a");
        final HtmlAnchor anchor =(HtmlAnchor) ele.get(0);
        final HtmlPage page2= anchor.click();

        Thread.sleep(3000);
        //checking whether there are images in the album
        assertTrue( page2.getElementById("albumImage").getAttribute("src").contains("/photark/gallery/vegas/dsc00")); //Don't use a specific image
        //as we can get <> order in <> OS
View Full Code Here

        final HtmlAnchor a =
            (HtmlAnchor) page.getByXPath( "//a[contains(@href, 'surefire260_TestB_testDup')]" ).get( 0 );
        final HtmlDivision content = (HtmlDivision) page.getElementById( "surefire260_TestB_testDuperror" );
        assertTrue( content.getAttribute( "style" ).contains( "none" ) );
        a.click();
        assertFalse( content.getAttribute( "style" ).contains( "none" ) );
        webClient.closeAllWindows();
    }
}
View Full Code Here

        final HtmlAnchor a =
            (HtmlAnchor) page.getByXPath( "//a[contains(@href, 'surefire260_TestB_testDup')]" ).get( 0 );
        final HtmlDivision content = (HtmlDivision) page.getElementById( "surefire260_TestB_testDuperror" );
        assertTrue( content.getAttribute( "style" ).contains( "none" ) );
        a.click();
        assertFalse( content.getAttribute( "style" ).contains( "none" ) );
        webClient.closeAllWindows();
    }
}
View Full Code Here

    private HtmlPage goToChangePreferredLocalePage(WebClient wc) throws Exception {
        login(wc);
        HtmlPage page = wc.getPage(url("/preferences/Preferences.action"));
        HtmlAnchor link = page.getAnchorByText("Choose your preferred language");
        HtmlPage result = link.click();
        wc.waitForBackgroundJavaScript(10000L);
        return result;
    }
}
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.