Examples of HtmlTable


Examples of com.gargoylesoftware.htmlunit.html.HtmlTable

   
    Iterator allHtmlChildElements = htmlElementsByTagName.iterator();
    int counter = 0;
   
    while (allHtmlChildElements.hasNext()) {
      HtmlTable table = (HtmlTable) allHtmlChildElements.next();
      HtmlTableCell handleCell = (HtmlTableCell) table.getCellAt(0, 0);
      HtmlTableCell iconCell = (HtmlTableCell) table.getCellAt(0, 1);
      HtmlTableCell textCell = (HtmlTableCell) table.getCellAt(0, 2);
     
      Element element = (Element) findNode(textCell.asText(), document);
      //skip text siblings
      Node nextSibling = element.getNextSibling();
     
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.html.HtmlTable

  }

  @Test
  public void testGallery() throws FailingHttpStatusCodeException, MalformedURLException, IOException, InterruptedException {
    final HtmlPage page = webClient.getPage("http://localhost:8080/photark/");
    final HtmlTable table = page.getHtmlElementById("tableGallery");
   
    //testing the static part of the gallery
    final String pageAsXml = page.asXml();
    assertTrue(pageAsXml.contains("<a href=\"javascript:displayGallery()\" onmouseover=\"document.index.src=index_on.src\" onmouseout=\"document.index.src=index_off.src\" onmousedown=\"beforeClick();\">"));
    assertTrue(pageAsXml.contains("<body onload=\"initGallery()\">"));
    final String pageAsText = page.asText();
    assertTrue(pageAsText.contains("Apache PhotArk Gallery"));
   
    Thread.sleep(3000);
    //testing the dynamic part of the gallery
   
    //albums loaded
    assertTrue( table.getRow(1).getCell(0).asText().contains("boston"));
    //Gallery pictures loaded
    assertTrue( table.getRow(3).getCell(0).asXml().contains("http://localhost:8080/photark/gallery/vegas/dsc00860.jpg"));
   
    //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
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.html.HtmlTable

  }

  @Test
  public void testGallery() throws FailingHttpStatusCodeException, MalformedURLException, IOException, InterruptedException {
    final HtmlPage page = webClient.getPage("http://localhost:8080/photark/");
    final HtmlTable table = page.getHtmlElementById("tableGallery");
   
    //testing the static part of the gallery
    final String pageAsXml = page.asXml();
    assertTrue(pageAsXml.contains("<a href=\"javascript:displayGallery()\" onmouseover=\"document.index.src=index_on.src\" onmouseout=\"document.index.src=index_off.src\" onmousedown=\"beforeClick();\">"));
    assertTrue(pageAsXml.contains("<body onload=\"initGallery()\">"));
    final String pageAsText = page.asText();
    assertTrue(pageAsText.contains("Apache PhotArk Gallery"));
   
    Thread.sleep(3000);
    //testing the dynamic part of the gallery
   
    //albums loaded
    assertTrue( table.getRow(1).getCell(0).asText().contains("boston"));
    //Gallery pictures loaded
    assertTrue( table.getRow(3).getCell(0).asXml().contains("http://localhost:8080/photark/gallery/vegas/dsc00860.jpg"));
   
    //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/dsc00860.jpg"));
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.html.HtmlTable

  }

  @Test
  public void testGallery() throws FailingHttpStatusCodeException, MalformedURLException, IOException, InterruptedException {
    final HtmlPage page = webClient.getPage("http://localhost:8080/photark/");
    final HtmlTable table = page.getHtmlElementById("tableGallery");
   
    //testing the static part of the gallery
    final String pageAsXml = page.asXml();
    assertTrue(pageAsXml.contains("<a href=\"javascript:displayGallery()\" onmouseover=\"document.index.src=index_on.src\" onmouseout=\"document.index.src=index_off.src\" onmousedown=\"beforeClick();\">"));
    assertTrue(pageAsXml.contains("<body onload=\"initGallery()\">"));
    final String pageAsText = page.asText();
    assertTrue(pageAsText.contains("Apache PhotArk Gallery"));
   
    Thread.sleep(3000);
    //testing the dynamic part of the gallery
   
    //albums loaded
    assertTrue( table.getRow(1).getCell(0).asText().contains("boston"));
    //Gallery pictures loaded
    assertTrue( table.getRow(3).getCell(0).asXml().contains("http://localhost:8080/photark/gallery/vegas/dsc00860.jpg"));
   
    //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/dsc00860.jpg"));
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.html.HtmlTable

        assertEquals( "Project", img.getAttribute( "alt" ) );

        // test object identity to distinguish the case ATTRIBUTE_VALUE_EMPTY
        assertTrue( img.getAttribute( "dummy" ) == HtmlElement.ATTRIBUTE_NOT_DEFINED );

        HtmlTable table = (HtmlTable) elementIterator.next();
        assertEquals( "1", table.getAttribute( "border" ) );
        assertEquals( "none", table.getAttribute( "class" ) );

        element = elementIterator.next();
        // this is a htmlunit bug
        assertEquals( "tbody", element.getTagName() );
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.html.HtmlTable

     * @return the index of the row within the parent table
     * @see <a href="http://msdn.microsoft.com/en-us/library/ms534377.aspx">MSDN Documentation</a>
     */
    public int jsxGet_rowIndex() {
        final HtmlTableRow row = (HtmlTableRow) getDomNodeOrDie();
        final HtmlTable table = row.getEnclosingTable();
        if (table == null) { // a not attached document.createElement('TR')
            return -1;
        }
        return table.getRows().indexOf(row);
    }
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.html.HtmlTable

     * @see <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-79105901">
     * DOM Level 1</a>
     */
    public int jsxGet_sectionRowIndex() {
        DomNode row = getDomNodeOrDie();
        final HtmlTable table = ((HtmlTableRow) row).getEnclosingTable();
        if (table == null) { // a not attached document.createElement('TR')
            if (!getBrowserVersion().isIE()) {
                return -1;
            }
            // IE 6, 7 and 8 return really strange values: large integers that are not constants
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.html.HtmlTable

      //client.getElement("historyDetailsPanel_body");
      HtmlDivision resultsDiv = (HtmlDivision) client.getElement("operationResults");
      if( null == resultsDiv )
        throw new HtmlElementNotFoundException("#operationResults - a div around a results table.");

      HtmlTable resultsTableElm = resultsDiv.getFirstByXPath(".//table[@class='properties-table']");
      if( null == resultsTableElm )
        throw new HtmlElementNotFoundException(".//table[@class='properties-table'] - a results table.");
      ContentTable resultsTable = ejtt.getTabMenu().getTabContentBox().getTable(resultsTableElm);
     
      // Process the results table.
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.html.HtmlTable

      ejtt.tabMenu.getTabContentBox().getButtonInputByLabel(EXECUTE_OP_NAME).click();

      // Command Line Arguments:  "-c"
      // No tab content box in this block.
      {
        HtmlTable resultsTableElm = ((HtmlForm)client.getElement("parametersForm")).getFirstByXPath(".//table[@class='properties-table']");
        ContentTable resultsTable = ejtt.getTable(resultsTableElm);

        ContentTableRow row = resultsTable.getFirstRowContainingText("Command Line Arguments");
        assertNotNull("'Command Line Arguments' row not found.", row);
        HtmlCheckBoxInput unsetCheckbox = row./*getCellByColumnName("Unset").*/ getElement().getFirstByXPath(".//input[@type='checkbox']");
        unsetCheckbox.setChecked(false);
        HtmlTextArea argsTA = row./*getCellByColumnName("Value").*/ getElement().getFirstByXPath(".//textarea"); // [@ondblclick='commandLineArguments']
        argsTA.setText("-c");
        DebugUtils.writeFile("target/scriptsWithParam-settingParams.html", client.getPageAsText());

        ejtt.sleep(2000);

        // Run.
        ((HtmlSubmitInput) client.getElement("parametersForm:okButton")).click();
      }


      // Wait for the operation to succesfuly finish.
      ejtt.operations.waitActivelyForOperationToFinish(EXECUTE_OP_NAME, 5000, 5);
      assertTrue(EXECUTE_OP_NAME+" operation wasn't successful.", ejtt.tabMenu.getTabContentBox().getOperationsHistoryTable().wasLastOperationSuccesful() );

      ejtt.sleep(2000);

      // Get the results table.
      //client.getElement("historyDetailsPanel_body");
      HtmlDivision resultsDiv = (HtmlDivision) client.getElement("operationResults");
      if( null == resultsDiv )
        throw new HtmlElementNotFoundException("#operationResults - a div around a results table.");

      HtmlTable resultsTableElm = resultsDiv.getFirstByXPath(".//table[@class='properties-table']");
      if( null == resultsTableElm )
        throw new HtmlElementNotFoundException(".//table[@class='properties-table'] - a results table.");
      ContentTable resultsTable = ejtt.getTabMenu().getTabContentBox().getTable(resultsTableElm);

      // Process the results table.
View Full Code Here

Examples of com.github.dandelion.datatables.core.html.HtmlTable

    if (tableId != null) {
     
      String confGroup = (String) RequestUtils.getFromRequest(DataTablesDialect.INTERNAL_CONF_GROUP, request);
     
      HtmlTable newHtmlTable = new HtmlTable(tableId, request, response, confGroup);

      // Add a default header row
      newHtmlTable.addHeaderRow();

      // Store the htmlTable POJO as a request attribute, so that all the
      // others following HTML tags can access it and particularly the
      // "finalizing div"
      RequestUtils.storeInRequest(DataTablesDialect.INTERNAL_BEAN_TABLE, newHtmlTable, request);
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.