Beispiel #1
0
  public void testCompositeInsertFacetNested02() throws Exception {

    HtmlPage page = getPage("/faces/composite/compositeInsertFacetNesting02.xhtml");
    List<HtmlTable> tables = new ArrayList<HtmlTable>();
    getAllElementsOfGivenClass(page, tables, HtmlTable.class);
    assertTrue(tables.size() == 1);
    HtmlTable table = tables.get(0);
    HtmlTableHeader header = table.getHeader();
    assertNotNull(header);
    assertEquals(header.asText(), "Header");
    HtmlTableFooter footer = table.getFooter();
    assertNotNull(footer);
    assertEquals(footer.asText(), "Footer");
  }
Beispiel #2
0
  public List<HtmlTableRow> getcources() {
    String eteraz = "eteraz_nomreh.aspx";
    try {
      page3 = web.getPage(url + "/" + eteraz);
      List<HtmlAnchor> anch = page3.getAnchors();

      page4 = page3.getAnchorByHref(anch.get(anch.size() - 1).getHrefAttribute()).click();

      HtmlTable tbl = page4.getHtmlElementById("ctl00_ContentPlaceHolder1_grdWorkBook");

      return tbl.getRows();
    } catch (FailingHttpStatusCodeException | IOException e) {

      e.printStackTrace();
    }
    return null;
  }
  private void validateTableStatus(
      HtmlPage page, boolean postConstructStatus, boolean preDestroyStatus) {

    HtmlTable table = (HtmlTable) page.getElementById("grid");
    assertNotNull(table);
    HtmlTableRow pcRow = table.getRow(1);
    HtmlTableCell pcStatus = pcRow.getCell(1);
    assertTrue(
        ((postConstructStatus)
            ? "Invoked".equals(pcStatus.asText())
            : pcStatus.asText().length() == 0));
    HtmlTableRow pdRow = table.getRow(2);
    HtmlTableCell pdStatus = pdRow.getCell(1);
    assertTrue(
        ((preDestroyStatus)
            ? "Invoked".equals(pdStatus.asText())
            : pdStatus.asText().length() == 0));
  }
  /**
   * Test regression https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=902.
   *
   * @throws Exception
   */
  public void testRowClasses() throws Exception {

    HtmlPage page = getPage("/faces/standard/dtablerowclasses.jsp");
    assertNotNull(page);
    List<HtmlTable> tableList = new ArrayList<HtmlTable>(1);
    getAllElementsOfGivenClass(page, tableList, HtmlTable.class);
    assertTrue(tableList.size() == 1);
    HtmlTable table = tableList.get(0);
    List<HtmlTableRow> rows = table.getRows();
    assertTrue(rows.size() == 6);
    for (int i = 0, len = rows.size(); i < len; i++) {
      HtmlTableRow row = rows.get(i);
      if (i % 2 == 0) {
        assertTrue(row.getClassAttribute().equals("b1"));
      } else {
        assertTrue(row.getClassAttribute().equals("b2"));
      }
    }
  }
  @SuppressWarnings("unchecked")
  List<String> getListOfPlayerIDs() throws Exception {
    final List<String> playerList = new ArrayList<String>();

    final HtmlPage page = (HtmlPage) this.webClient.getPage(STATS_PAGE_2012);
    final HtmlTable battingStatsTable = (HtmlTable) page.getElementById(BATTING_TABLE_ID);

    final List<HtmlTableRow> statRows =
        (List<HtmlTableRow>) battingStatsTable.getByXPath("//tr[contains(@class, 'full_table')]");
    for (HtmlTableRow row : statRows) {
      final DomNodeList<HtmlElement> dataCells =
          (DomNodeList<HtmlElement>) row.getElementsByTagName("td");
      final HtmlAnchor playerLink = (HtmlAnchor) dataCells.get(1).getElementsByTagName("a").get(0);
      playerList.add(
          StringUtils.substringAfterLast(playerLink.getHrefAttribute().replace(".shtml", ""), "/"));
    }

    return playerList;
  }
  @LocalData
  public void testOldActionViewsWithData() throws Exception {
    WebClient wc = getWebClient();
    HtmlPage page = wc.goTo("job/oldrobotbuild/");
    WebAssert.assertElementPresentByXPath(
        page, "//div[@id='navigation']//a[@href='/job/oldrobotbuild/robot']");
    WebAssert.assertElementPresentByXPath(
        page, "//td[@id='main-panel']//h4[contains(.,'Latest Robot Results:')]");
    WebAssert.assertElementPresentByXPath(page, "//td[@id='main-panel']//img[@src='robot/graph']");
    WebAssert.assertElementPresentByXPath(
        page,
        "//td[@id='main-panel']//a[@href='/job/oldrobotbuild/1/robot' and contains(text(),'Browse results')]");
    HtmlTable table = page.getHtmlElementById("robot-summary-table");
    Assert.assertTrue(
        table
            .asXml()
            .replaceAll("\\s", "")
            .contains(
                "<tableclass=\"table\"id=\"robot-summary-table\"><tbodyalign=\"left\"><tr><th/><th>Total</th><th>Failed</th><th>Passed</th><th>Pass%</th></tr><tr><th>Criticaltests</th><tdclass=\"table-upper-row\"style=\"border-left:0px;\">8</td><tdclass=\"table-upper-row\"><spanclass=\"fail\">4</span></td><tdclass=\"table-upper-row\">4</td><tdclass=\"table-upper-row\">50.0</td></tr><tr><th>Alltests</th><tdstyle=\"border-left:0px;\">8</td><td><spanclass=\"fail\">4</span></td><td>4</td><td>50.0</td></tr></tbody></table>"));

    page = wc.goTo("job/oldrobotbuild/robot/");
    WebAssert.assertTitleEquals(page, "Testcases & Othercases Test Report");

    page = wc.goTo("job/oldrobotbuild/1/");
    WebAssert.assertElementPresentByXPath(
        page, "//div[@id='navigation']//a[@href='/job/oldrobotbuild/1/robot']");
    WebAssert.assertElementPresentByXPath(
        page, "//td[@id='main-panel']//h4[contains(.,'Robot Test Summary:')]");
    WebAssert.assertElementPresentByXPath(
        page,
        "//td[@id='main-panel']//a[@href='/job/oldrobotbuild/1/robot' and contains(text(),'Browse results')]");
    table = page.getHtmlElementById("robot-summary-table");
    Assert.assertTrue(
        table
            .asXml()
            .replaceAll("\\s", "")
            .contains(
                "<tableclass=\"table\"id=\"robot-summary-table\"><tbodyalign=\"left\"><tr><th/><th>Total</th><th>Failed</th><th>Passed</th><th>Pass%</th></tr><tr><th>Criticaltests</th><tdclass=\"table-upper-row\"style=\"border-left:0px;\">8</td><tdclass=\"table-upper-row\"><spanclass=\"fail\">4</span></td><tdclass=\"table-upper-row\">4</td><tdclass=\"table-upper-row\">50.0</td></tr><tr><th>Alltests</th><tdstyle=\"border-left:0px;\">8</td><td><spanclass=\"fail\">4</span></td><td>4</td><td>50.0</td></tr></tbody></table>"));

    page = wc.goTo("job/oldrobotbuild/1/robot/");
    WebAssert.assertTitleEquals(page, "Testcases & Othercases Test Report");
  }
Beispiel #7
0
  public static void main(String[] args) throws Exception {
    // Create and initialize WebClient object
    // Create and initialize WebClient object
    String dualPwd = "xxxxxx";
    WebClient webClient = new WebClient(BrowserVersion.FIREFOX_38);
    // webClient.throwFailingHttpStatusCodeExceptionIfNecessary(webResponse);

    // visit Yahoo Mail login page and get the Form object
    HtmlPage page =
        (HtmlPage)
            webClient.getPage(
                "https://www.ebanking.hsbc.com.hk/1/2/logon?LANGTAG=en&COUNTRYTAG=US");
    HtmlForm form = page.getFormByName("User");

    // Enter login and passwd
    form.getInputByName("u_UserID").setValueAttribute("charlieskc");
    page = (HtmlPage) form.getInputByValue("press").setValueAttribute("click");
    List<HtmlAnchor> anchorList = page.getAnchors();
    for (HtmlAnchor anchor : anchorList) {
      if (anchor
          .getOnClickAttribute()
          .equals(
              "document.getElementById('submittype').value = 'click';PC_7_0G3UNU10SD0MHTI7TQA0000000000000_selectLogonMode(0)")) {
        System.out.println(anchor.getHrefAttribute());
        System.out.println(anchor.getOnClickAttribute());
        page = anchor.click();
        // System.out.println(page.asXml());
      }
    }

    HtmlForm passwordform = page.getFormByName("PC_7_0G3UNU10SD0MHTI7EMA0000000000000_pwd");
    passwordform.getInputByName("memorableAnswer").setValueAttribute("z0226409");

    HtmlForm secondPasswordform =
        page.getFormByName("PC_7_0G3UNU10SD0MHTI7EMA0000000000000_2ndpwd");
    // secondPasswordform.getInputByName("memorableAnswer").setValueAttribute("z0226409");

    HtmlTable table = getTableFromDomElement(secondPasswordform);

    System.out.println("Table xml" + table.asXml());

    for (HtmlElement element : secondPasswordform.getHtmlElementDescendants()) {
      // System.out.println(element.asXml());
    }

    ScriptResult result =
        page.executeJavaScript("PC_7_0G3UNU10SD0MHTI7TQA0000000000000_selectLogonMode(0)");
    page = (HtmlPage) result.getNewPage();

    // System.out.println("result: "+ result);

    // System.out.println("result: " + page.asXml());

    // form.getInputByName("logonMode").setValueAttribute("charlieskc");
    // form.getInputByName("passwd").setValueAttribute("@@@@@@@");

    // Click "Sign In" button/link

    // Click "Inbox" link
    HtmlAnchor anchor = (HtmlAnchor) page.getHtmlElementById("WelcomeInboxFolderLink");
    page = (HtmlPage) anchor.click();

    // Get the table object containing the mails
    HtmlTable dataTable = (HtmlTable) page.getHtmlElementById("datatable");

    // Go through each row and count the row with class=msgnew
    int newMessageCount = 0;
    List<HtmlTableRow> rows = (List) dataTable.getHtmlElementsByTagName("tr");
    for (HtmlTableRow row : rows) {
      if (row.getAttribute("class").equals("msgnew")) {
        newMessageCount++;
      }
    }

    // Print the newMessageCount to screen
    System.out.println("newMessageCount = " + newMessageCount);

    // System.out.println(page.asXml());
  }
  @Test
  public void testAll() throws Exception {
    HtmlPage page = (HtmlPage) this.client.getContentPage();

    try {
      // Welcome page

      assertTrue(page.asText().contains("Welcome to Forge"));

      // Create an Owner

      page = page.getAnchorByText("Owner").click();
      assertTrue(page.asText().contains("Search Owner entities"));
      page = page.getAnchorByText("Create New").click();

      HtmlForm form = page.getFormByName("create");
      assertTrue(page.asText().contains("Create a new Owner"));
      form.getInputByName("create:ownerBeanOwnerFirstName").setValueAttribute("Owner Firstname #1");
      form.getInputByName("create:ownerBeanOwnerLastName").setValueAttribute("Owner Lastname #1");
      page = page.getAnchorByText("Save").click();

      // Edit the Owner

      assertTrue(page.asText().contains("Search Owner entities"));
      HtmlTable table = (HtmlTable) page.getHtmlElementById("search:ownerBeanPageItems");
      assertEquals("Owner Firstname #1", table.getCellAt(1, 0).getTextContent());
      assertEquals("Owner Lastname #1", table.getCellAt(1, 1).getTextContent());

      page = page.getAnchorByText("Owner Firstname #1").click();
      assertTrue(page.asText().contains("View existing Owner"));
      assertEquals(
          "Owner Firstname #1",
          page.getHtmlElementById("ownerBeanOwnerFirstName").getTextContent());
      assertEquals(
          "Owner Lastname #1", page.getHtmlElementById("ownerBeanOwnerLastName").getTextContent());
      assertEquals("", page.getHtmlElementById("ownerBeanOwnerAddress").getTextContent());
      page = page.getAnchorByText("Edit").click();

      form = page.getFormByName("create");
      form.getInputByName("create:ownerBeanOwnerAddress").setValueAttribute("Owner Address #1");
      page = page.getAnchorByText("Save").click();
      assertTrue(page.asText().contains("View existing Owner"));
      assertEquals(
          "Owner Address #1", page.getHtmlElementById("ownerBeanOwnerAddress").getTextContent());

      page = page.getAnchorByText("View All").click();
      assertTrue(page.asText().contains("Search Owner entities"));

      // Create a Pet and associate it with the Owner

      page = page.getAnchorByText("Pet").click();
      assertTrue(page.asText().contains("Search Pet entities"));
      page = page.getAnchorByText("Create New").click();

      form = page.getFormByName("create");
      form.getInputByName("create:petBeanPetName").setValueAttribute("Pet #1");
      form.getInputByName("create:petBeanPetType").setValueAttribute("2");
      form.getInputByName("create:petBeanPetSendReminders").setChecked(true);
      form.getSelectByName("create:petBeanPetOwner").setSelectedAttribute("1", true);
      page = page.getAnchorByText("Save").click();

      // Click through from the Pet to the Owner

      table = (HtmlTable) page.getHtmlElementById("search:petBeanPageItems");
      assertEquals("Pet #1", table.getCellAt(1, 0).getTextContent());
      assertEquals("2", table.getCellAt(1, 1).getTextContent());
      DomNode booleanNode = table.getCellAt(1, 2).getChildNodes().get(0).getChildNodes().get(0);

      assertEquals("span", booleanNode.getNodeName());
      assertEquals("", booleanNode.getTextContent());
      assertEquals(
          "boolean-true", booleanNode.getAttributes().getNamedItem("class").getNodeValue());

      assertEquals(
          "Owner firstName: Owner Firstname #1, lastName: Owner Lastname #1, address: Owner Address #1",
          table.getCellAt(1, 3).getTextContent());

      page = page.getAnchorByText("Pet #1").click();
      assertTrue(page.asText().contains("View existing Pet"));
      page =
          page.getAnchorByText(
                  "Owner firstName: Owner Firstname #1, lastName: Owner Lastname #1, address: Owner Address #1")
              .click();
      assertTrue(page.asText().contains("View existing Owner"));

      // Create a new Owner

      page = page.getAnchorByText("Create New").click();
      form = page.getFormByName("create");
      form.getInputByName("create:ownerBeanOwnerFirstName").setValueAttribute("Owner Firstname #2");
      form.getInputByName("create:ownerBeanOwnerLastName").setValueAttribute("Owner Lastname #2");
      page = page.getAnchorByText("Save").click();

      table = (HtmlTable) page.getHtmlElementById("search:ownerBeanPageItems");
      assertEquals("Owner Firstname #1", table.getCellAt(1, 0).getTextContent());
      assertEquals("Owner Lastname #1", table.getCellAt(1, 1).getTextContent());
      assertEquals("Owner Firstname #2", table.getCellAt(2, 0).getTextContent());
      assertEquals("Owner Lastname #2", table.getCellAt(2, 1).getTextContent());

      // Search for a Pet by Owner

      page = page.getAnchorByText("Pet").click();
      assertTrue(page.asText().contains("Search Pet entities"));

      table = (HtmlTable) page.getHtmlElementById("search:petBeanPageItems");
      assertEquals("Pet #1", table.getCellAt(1, 0).getTextContent());

      form = page.getFormByName("search");
      form.getSelectByName("search:petBeanExampleOwner").setSelectedAttribute("3", true);
      page = page.getAnchorByText("Search").click();
      table = (HtmlTable) page.getHtmlElementById("search:petBeanPageItems");
      assertEquals("", table.getCellAt(1, 0).getTextContent());

      form = page.getFormByName("search");
      form.getSelectByName("search:petBeanExampleOwner").setSelectedAttribute("1", true);
      page = page.getAnchorByText("Search").click();
      page = page.getAnchorByText("Pet #1").click();

      // Delete a Pet

      assertTrue(page.asText().contains("View existing Pet"));
      page = page.getAnchorByText("Edit").click();
      assertTrue(page.asText().contains("Edit existing Pet"));
      page = page.getAnchorByText("Cancel").click();
      assertTrue(page.asText().contains("View existing Pet"));
      page = page.getAnchorByText("Edit").click();
      page = page.getAnchorByText("Delete").click();
      assertTrue(page.asText().contains("Search Pet entities"));
      table = (HtmlTable) page.getHtmlElementById("search:petBeanPageItems");
      assertEquals("", table.getCellAt(1, 0).getTextContent());
    } catch (Throwable t) {
      t.printStackTrace();
      throw new RuntimeException(t);
    } finally {
      System.out.println(page.asXml());
    }
  }
Beispiel #9
0
  /**
   * Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods.
   *
   * @param request servlet request
   * @param response servlet response
   * @throws ServletException if a servlet-specific error occurs
   * @throws IOException if an I/O error occurs
   */
  protected void processRequest(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException {
    response.setContentType("text/html;charset=UTF-8");
    PrintWriter out = response.getWriter();

    int no = 0;
    try {
      no = Integer.parseInt(request.getParameter("no"));

    } catch (NumberFormatException exception) {
      no = 0;
    }

    try {
      /* TODO output your page here. You may use following sample code. */
      out.println("<!DOCTYPE html>");
      out.println("<html>");
      out.println("<head>");
      out.println("<title>Servlet NewServlet</title>");
      out.println("</head>");
      out.println("<body>");

      final WebClient webClient = new WebClient();
      webClient.getCookieManager().clearCookies();
      webClient.getOptions().setUseInsecureSSL(true);
      webClient.setJavaScriptEnabled(false);
      final HtmlPage page = webClient.getPage("https://filestream.me/");
      // out.println(page.getTitleText());
      System.out.println("no of forms : " + page.getForms().size());
      HtmlForm form = page.getForms().get(1);
      final HtmlTextInput textField = form.getInputByName("login");
      textField.setAttribute("value", "*****@*****.**");

      final HtmlPasswordInput passField = form.getInputByName("password");
      passField.setAttribute("value", "ramkrishnan18");
      HtmlSubmitInput htmlSubmitInput = form.getInputByValue("login");
      HtmlPage page1 = htmlSubmitInput.click();

      HtmlTable htmlTable = page1.getHtmlElementById("fileCatTable");
      List<HtmlTableRow> listOfHtmlTableRow = htmlTable.getBodies().get(0).getRows();
      List<String> allLinks = new ArrayList<String>();
      for (HtmlTableRow htmlTableRow : listOfHtmlTableRow) {
        HtmlTableCell cell = htmlTableRow.getCells().get(htmlTableRow.getCells().size() - 1);
        for (DomElement domElement : cell.getChildElements()) {
          // out.println(domElement.getTagName());
          if (domElement.getTagName().equals("div")) {
            boolean flag = true;

            for (DomElement celldomElement : domElement.getChildElements()) {
              if (flag) {
                // out.println(celldomElement.getTagName());

                String title = celldomElement.getAttribute("title");
                if ("Download".equals(title) || "Downloads".equals(title)) {

                  String link = celldomElement.getAttribute("onclick");
                  String http =
                      link.substring(
                          link.indexOf('\'') + 1, link.indexOf('\'', link.indexOf('\'') + 1));

                  //  out.println(celldomElement.getAttribute("onclick") + "<br/>");
                  // out.println(http + "<br/>");
                  allLinks.add(http);
                  flag = false;
                }
              }
            }
          }
        }
      }

      //  InputStream is =anchorAttachment.click().getWebResponse().getContentAsStream();

      out.println("************ Start *************");

      //  HtmlAnchor anchorElement=HTMLAnchorElement.;
      //  anchorElement.set
      // anchorElement.setHref(allLinks.get(0));

      //  anchorElement.cl
      final String u = allLinks.get(no);
      Thread t =
          new Thread(
              new Runnable() {
                @Override
                public void run() {
                  try {
                    URL url = new URL(u);
                    System.out.println("Link : " + u);
                    HttpURLConnection con = (HttpURLConnection) url.openConnection();

                    // System.out.println("Response Code : " + con.getInputStream().available());
                    con.setRequestProperty("Accept-Encoding", "gzip,deflate");
                    con.setRequestProperty(
                        "User-Agent",
                        "Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.71 Safari/537.36");

                    Map<String, List<String>> map = con.getHeaderFields();

                    for (String object : map.keySet()) {
                      System.out.println(object + " --> " + map.get(object));
                    }

                    System.out.println("Response Code : " + con.getResponseCode());
                    System.out.println("length :" + con.getContentLength());
                    System.out.println("Message " + con.getResponseMessage());

                    InputStream inputStream = con.getInputStream();
                    String path = System.getenv("OPENSHIFT_JBOSSAS_DIR");
                    FileOutputStream fileOutputStream = new FileOutputStream(path + "test.zip");
                    byte[] buffer = new byte[1024];
                    System.out.println(inputStream.available());
                    int bytesRead = 10;
                    while (true) {
                      //   System.out.print("--");
                      bytesRead = inputStream.read(buffer);
                      //   System.out.println(bytesRead);
                      if (bytesRead == -1) {
                        break;
                      }
                      fileOutputStream.write(buffer, 0, bytesRead);
                      // System.out.print(">");
                    }
                    fileOutputStream.close();

                    System.out.println("File Completed");
                  } catch (IOException ex) {
                    Logger.getLogger(MakeData.class.getName()).log(Level.SEVERE, null, ex);
                  }
                }
              });
      t.start();

      //            System.out.println(allLinks.get(0));
      //            System.out.println(webClient.getCookieManager().getCookies(new
      // URL(allLinks.get(0))).size());
      //            // System.out.println(httpPage.asText());
      //             HtmlPage httpPage = webClient.getPage(allLinks.get(0));
      //
      //           // final String pageAsXml = page1.asXml();
      //            // InputStream inputStream=httpPage.getWebResponse().getContentAsStream();
      //           //  inputStream.available();
      //              System.out.println("Code : "+httpPage.getWebResponse().getStatusMessage());
      //               System.out.println("Code : "+httpPage.getWebResponse().getContentType());
      //                System.out.println("netCode :
      // "+httpPage.getWebResponse().getContentCharset());
      //
      // out.println("<br/><br/>Code : "+httpPage.getWebResponse().getStatusCode());
      // out.println("<br/><br/>Code : "+httpPage.getWebResponse().getContentType());
      // out.println("<br/><br/>Code : "+httpPage.getWebResponse().getContentCharset());

      // final String pageAsText = page1.asText();

      // out.println(pageAsXml);
      webClient.closeAllWindows();
      out.println("<h1>Servlet NewServlet at " + request.getContextPath() + "</h1>");
      out.println("</body>");
      out.println("</html>");
    } finally {
      out.close();
    }
  }
  @LocalData
  public void testSummariesWithData() throws Exception {
    Hudson hudson = Hudson.getInstance();
    List<Project> projects = hudson.getProjects();
    Project testProject = null;
    for (Project project : projects) {
      if (project.getName().equals("robot")) testProject = project;
    }
    if (testProject == null) fail("Couldn't find example project");
    Future<Run> run = testProject.scheduleBuild2(0);

    while (!run.isDone()) {
      Thread.sleep(5);
    }

    Run lastBuild = testProject.getLastBuild();
    assertTrue("Build wasn't a success", lastBuild.getResult() == Result.SUCCESS);

    WebClient wc = getWebClient();

    HtmlPage page = wc.goTo("job/robot/");
    WebAssert.assertElementPresentByXPath(
        page, "//div[@id='navigation']//a[@href='/job/robot/robot']");
    WebAssert.assertElementPresentByXPath(
        page, "//td[@id='main-panel']//h4[contains(.,'Latest Robot Results:')]");
    WebAssert.assertElementPresentByXPath(page, "//td[@id='main-panel']//img[@src='robot/graph']");
    WebAssert.assertElementPresentByXPath(
        page,
        "//td[@id='main-panel']//a[@href='/job/robot/1/robot' and contains(text(),'Browse results')]");
    WebAssert.assertElementPresentByXPath(
        page,
        "//td[@id='main-panel']//a[@href='/job/robot/1/robot/report/report.html' and contains(text(), 'Open report.html')]");
    WebAssert.assertElementPresentByXPath(
        page,
        "//td[@id='main-panel']//a[@href='/job/robot/1/robot/report/log.html' and contains(text(), 'Open log.html')]");

    HtmlTable table = page.getHtmlElementById("robot-summary-table");
    Assert.assertTrue(
        table
            .asXml()
            .replaceAll("\\s", "")
            .contains(
                "<tableclass=\"table\"id=\"robot-summary-table\"><tbodyalign=\"left\"><tr><th/><th>Total</th><th>Failed</th><th>Passed</th><th>Pass%</th></tr><tr><th>Criticaltests</th><tdclass=\"table-upper-row\"style=\"border-left:0px;\">8</td><tdclass=\"table-upper-row\"><spanclass=\"fail\">4</span></td><tdclass=\"table-upper-row\">4</td><tdclass=\"table-upper-row\">50.0</td></tr><tr><th>Alltests</th><tdstyle=\"border-left:0px;\">8</td><td><spanclass=\"fail\">4</span></td><td>4</td><td>50.0</td></tr></tbody></table>"));

    page = wc.goTo("job/robot/1/");
    WebAssert.assertElementPresentByXPath(
        page, "//div[@id='navigation']//a[@href='/job/robot/1/robot']");
    WebAssert.assertElementPresentByXPath(
        page, "//td[@id='main-panel']//h4[contains(.,'Robot Test Summary:')]");
    WebAssert.assertElementPresentByXPath(
        page,
        "//td[@id='main-panel']//a[@href='/job/robot/1/robot' and contains(text(),'Browse results')]");
    WebAssert.assertElementPresentByXPath(
        page,
        "//td[@id='main-panel']//a[@href='/job/robot/1/robot/report/report.html' and contains(text(), 'Open report.html')]");
    WebAssert.assertElementPresentByXPath(
        page,
        "//td[@id='main-panel']//a[@href='/job/robot/1/robot/report/log.html' and contains(text(), 'Open log.html')]");
    table = page.getHtmlElementById("robot-summary-table");
    Assert.assertTrue(
        table
            .asXml()
            .replaceAll("\\s", "")
            .contains(
                "<tableclass=\"table\"id=\"robot-summary-table\"><tbodyalign=\"left\"><tr><th/><th>Total</th><th>Failed</th><th>Passed</th><th>Pass%</th></tr><tr><th>Criticaltests</th><tdclass=\"table-upper-row\"style=\"border-left:0px;\">8</td><tdclass=\"table-upper-row\"><spanclass=\"fail\">4</span></td><tdclass=\"table-upper-row\">4</td><tdclass=\"table-upper-row\">50.0</td></tr><tr><th>Alltests</th><tdstyle=\"border-left:0px;\">8</td><td><spanclass=\"fail\">4</span></td><td>4</td><td>50.0</td></tr></tbody></table>"));
  }