Package com.gargoylesoftware.htmlunit.html

Examples of com.gargoylesoftware.htmlunit.html.HtmlPage.asText()


          //for(int i=0; i<collectedAlerts.size(); i++){
            //System.out.println("alert msg:"+collectedAlerts.get(i));
          //}
        //}

        String commandResultText = commandResult.asText();
        //System.out.println("initial commandResultText-->\n"+commandResultText);

        while(commandResultText.indexOf("das:DataGraphRoot") == -1){
          Thread.sleep(1000);
          commandResultText = commandResult.asText();
View Full Code Here


        String commandResultText = commandResult.asText();
        //System.out.println("initial commandResultText-->\n"+commandResultText);

        while(commandResultText.indexOf("das:DataGraphRoot") == -1){
          Thread.sleep(1000);
          commandResultText = commandResult.asText();
        }

        //System.out.println("commandResultText-->\n" + commandResultText);

        assertTrue(-1 != commandResultText.indexOf("Roosevelt"));
View Full Code Here

        HtmlPage menuPage = (HtmlPage)menuFrame.getEnclosedPage();

        //basic content
        HtmlAnchor commandAnchor = menuPage.getAnchorByHref("./converter.jsp");
        HtmlPage commandPage = (HtmlPage)commandAnchor.click();
        String commandText = commandPage.asText();
        //System.out.println("command html-->\n" + commandText);
        assertTrue(-1 != commandText.indexOf("Arbitrary Converter:"));//heading
        assertTrue(-1 != commandText.indexOf("ExecuteTransaction"));//button text

        //list values
View Full Code Here

          //for(int i=0; i<collectedAlerts.size(); i++){
            //System.out.println("alert msg:"+collectedAlerts.get(i));
          //}
        //}

        String commandResultText = commandResult.asText();
        //System.out.println("initial commandResultText-->\n"+commandResultText);

        while(commandResultText.indexOf("das:DataGraphRoot") == -1){
          Thread.sleep(1000);
          commandResultText = commandResult.asText();
View Full Code Here

        String commandResultText = commandResult.asText();
        //System.out.println("initial commandResultText-->\n"+commandResultText);

        while(commandResultText.indexOf("das:DataGraphRoot") == -1){
          Thread.sleep(1000);
          commandResultText = commandResult.asText();
          //System.out.println("commandResultText-->\n" + commandResultText);
        }
        assertTrue(-1 != commandResultText.indexOf("1957"));

        collectedAlerts.clear();
View Full Code Here

  }

  @Test
  public void testPipelining() throws Exception {
    HtmlPage page = executePageTest("pipeliningTest", null);
    JSONArray array = new JSONArray(page.asText());
    assertEquals(3, array.length());
    Map<String, JSONObject> jsonObjects = Maps.newHashMap();
    for (int i = 0; i < array.length(); i++) {
      JSONObject jsonObj = array.getJSONObject(i);
      assertTrue(jsonObj.has("id"));
View Full Code Here

    // ------------------------------------------------- Individual Test Methods

    public void testSetPropertyPositive() throws Exception {
        HtmlPage page = getPage("/faces/jsp/jsp-setProperty-01.jsp");
        assertTrue(-1 != page.asText().indexOf("default value"));
        // press the button to submit the literal value
        List buttons = getAllElementsOfGivenClass(page, new ArrayList(),
                HtmlSubmitInput.class);
        page = (HtmlPage) ((HtmlSubmitInput)buttons.get(0)).click();
        assertTrue(-1 != page.asText().indexOf("literal value"));
View Full Code Here

        assertTrue(-1 != page.asText().indexOf("default value"));
        // press the button to submit the literal value
        List buttons = getAllElementsOfGivenClass(page, new ArrayList(),
                HtmlSubmitInput.class);
        page = (HtmlPage) ((HtmlSubmitInput)buttons.get(0)).click();
        assertTrue(-1 != page.asText().indexOf("literal value"));
       
        // press the button to submit the expression value
        buttons = getAllElementsOfGivenClass(page, new ArrayList(),
                HtmlSubmitInput.class);
        page = (HtmlPage) ((HtmlSubmitInput)buttons.get(1)).click();
View Full Code Here

       
        // press the button to submit the expression value
        buttons = getAllElementsOfGivenClass(page, new ArrayList(),
                HtmlSubmitInput.class);
        page = (HtmlPage) ((HtmlSubmitInput)buttons.get(1)).click();
        assertTrue(-1 != page.asText().indexOf("This is a String property"));
       
        // press the button to increment the property
        buttons = getAllElementsOfGivenClass(page, new ArrayList(),
                HtmlSubmitInput.class);
        page = (HtmlPage) ((HtmlSubmitInput)buttons.get(2)).click();
View Full Code Here

       
        // press the button to increment the property
        buttons = getAllElementsOfGivenClass(page, new ArrayList(),
                HtmlSubmitInput.class);
        page = (HtmlPage) ((HtmlSubmitInput)buttons.get(2)).click();
        assertTrue(-1 != page.asText().indexOf("0"));
       
        // press the button to increment the property
        buttons = getAllElementsOfGivenClass(page, new ArrayList(),
                HtmlSubmitInput.class);
        page = (HtmlPage) ((HtmlSubmitInput)buttons.get(2)).click();
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.