Package com.gargoylesoftware.htmlunit.html

Examples of com.gargoylesoftware.htmlunit.html.HtmlButtonInput


    Thread.sleep(interval*4);
    Date endDate = pb.getLasttime();
    assertFalse("Date is not being updated in the PollBean",startDate.equals(endDate));
   
    // Get control button and disable polling
    HtmlButtonInput button = (HtmlButtonInput)client.getElement(_BUTTON_ID);
    assertNotNull("Can't find polling control button ["+_BUTTON_ID+"]",button);
    button.click();

    // Wait for polling state to change
    Thread.sleep(interval*2);   
   
    // Make sure we're no longer polling
    assertFalse("Polling should be disabled in the PollBean",pb.getPollEnabled());
    // Check the server-side control also (TBD: This causes IllegalStateException)
//    poll = (UIPoll)server.findComponent(_POLL_ID);
//    assertFalse("Polling should be disabled in the component",poll.isEnabled());
    // Make sure the date is NOT updating
    startDate = pb.getLasttime();
    Thread.sleep(interval*4);
    endDate = pb.getLasttime();
    assertTrue("Date should not be updating in the PollBean",startDate.equals(endDate));
   
    // Turn polling back on (page was updated, therefore we MUST re-get the control)
    button = (HtmlButtonInput)client.getElement(_BUTTON_ID)
    button.click();

    // Wait for polling state to change
    Thread.sleep(interval*2);   
   
    // Make sure we're polling again
View Full Code Here


        System.out.print("Running:" + TEST_CASE + "\t\t");

        final HtmlPage page = (HtmlPage) _webClient.getPage(_url);
        FrameWindow menuFrame = page.getFrameByName("fixed");
        HtmlPage menuPage = (HtmlPage)menuFrame.getEnclosedPage();
        HtmlButtonInput commandButton = (HtmlButtonInput)menuPage.getFormByName("MenuForm").getHtmlElementById("refreshButton");
        HtmlPage commandResult = null;
        if(commandButton != null){
          //System.out.println("command button text:"+commandButton.asText());
          commandButton.focus();
          //System.out.println("command button script:"+commandButton.getOnClickAttribute());
          commandResult = (HtmlPage)commandButton.click();
        }

        //System.out.println("alerts size:"+collectedAlerts.size());
        //if(collectedAlerts.size() > 0){
          //for(int i=0; i<collectedAlerts.size(); i++){
View Full Code Here

        assertTrue(-1 != allOptionsText.indexOf("INSERT INTO DEPARTMENT (NAME, COMPANYID) VALUES ('MyDept',1)"));//check each option
        assertTrue(-1 != allOptionsText.indexOf("DELETE FROM DEPARTMENT WHERE DEPARTMENT.COMPANYID=1 and DEPARTMENT.ID>1"));//check each option
        assertTrue(-1 != allOptionsText.indexOf("UPDATE DEPARTMENT SET NAME='MyUpdDept' WHERE COMPANYID=1 AND ID=1"));//check each option

        //check result
        HtmlButtonInput adhocButton = (HtmlButtonInput)adhocForm.getHtmlElementById("queryButton");
        adhocButton.focus();
        HtmlPage adhocResult = (HtmlPage)adhocButton.click();
        String adhocResultText = adhocResult.asText();
        //System.out.println("initial result:"+adhocResultText);

        //System.out.println("alerts size:"+collectedAlerts.size());
        //if(collectedAlerts.size() > 0){
View Full Code Here

        assertTrue(-1 != allOptionsText.indexOf("AddDepartmentToFirstCompany"));//check each option
        assertTrue(-1 != allOptionsText.indexOf("DeleteDepartmentFromFirstCompany"));//check each option
        assertTrue(-1 != allOptionsText.indexOf("UpdateCompanyDepartmentNames"));//check each option

        //check result
        HtmlButtonInput commandButton = (HtmlButtonInput)commandForm.getHtmlElementById("commandButton");
        HtmlPage commandResult = null;
        if(commandButton != null){
          //System.out.println("command button text:"+commandButton.asText());
          commandButton.focus();
          //System.out.println("command button script:"+commandButton.getOnClickAttribute());
          commandResult = (HtmlPage)commandButton.click();
        }


        //System.out.println("alerts size:"+collectedAlerts.size());
        //if(collectedAlerts.size() > 0){
View Full Code Here

        assertTrue(-1 != allOptionsText.indexOf("INSERT INTO DEPARTMENT (NAME, COMPANYID) VALUES ('MyDept',1)"));//check each option
        assertTrue(-1 != allOptionsText.indexOf("DELETE FROM DEPARTMENT WHERE DEPARTMENT.COMPANYID=1 and DEPARTMENT.ID>1"));//check each option
        assertTrue(-1 != allOptionsText.indexOf("UPDATE DEPARTMENT SET NAME='MyUpdDept' WHERE COMPANYID=1 AND ID=1"));//check each option

        //check result
        HtmlButtonInput adhocButton = (HtmlButtonInput)adhocForm.getHtmlElementById("queryButton");
        HtmlPage adhocResult = (HtmlPage)adhocButton.click();

        //System.out.println("alerts size:"+collectedAlerts.size());
        //if(collectedAlerts.size() > 0){
          //for(int i=0; i<collectedAlerts.size(); i++){
            //System.out.println("alert msg:"+collectedAlerts.get(i));
View Full Code Here

        assertTrue(-1 != allOptionsText.indexOf("AddDepartmentToFirstCompany"));//check each option
        assertTrue(-1 != allOptionsText.indexOf("DeleteDepartmentFromFirstCompany"));//check each option
        assertTrue(-1 != allOptionsText.indexOf("UpdateCompanyDepartmentNames"));//check each option

        //check result
        HtmlButtonInput commandButton = (HtmlButtonInput)commandForm.getHtmlElementById("commandButton");
        HtmlPage commandResult = null;
        if(commandButton != null){
          //System.out.println("command button text:"+commandButton.asText());
          commandButton.focus();
          //System.out.println("command button script:"+commandButton.getOnClickAttribute());
          commandResult = (HtmlPage)commandButton.click();
        }


        //System.out.println("alerts size:"+collectedAlerts.size());
        //if(collectedAlerts.size() > 0){
View Full Code Here

        assertTrue(-1 != commandText.indexOf("ExecuteTransaction"));//button text

        //list values
        HtmlForm commandForm = commandPage.getFormByName("DasForm");
        //check result
        HtmlButtonInput commandButton = (HtmlButtonInput)commandForm.getHtmlElementById("occButton");
        HtmlPage commandResult = null;
        if(commandButton != null){
          //System.out.println("command button text:"+commandButton.asText());
          commandButton.focus();
          //System.out.println("command button script:"+commandButton.getOnClickAttribute());
          commandResult = (HtmlPage)commandButton.click();
        }

        //System.out.println("alerts size:"+collectedAlerts.size());
        //if(collectedAlerts.size() > 0){
          //for(int i=0; i<collectedAlerts.size(); i++){
View Full Code Here

        assertTrue(-1 != commandText.indexOf("ExecuteQuery"));//button text

        //list values
        HtmlForm commandForm = commandPage.getFormByName("DasForm");
        //check result
        HtmlButtonInput commandButton = (HtmlButtonInput)commandForm.getHtmlElementById("rssButton");
        HtmlPage commandResult = null;
        if(commandButton != null){
          //System.out.println("command button text:"+commandButton.asText());
          commandButton.focus();
          //System.out.println("command button script:"+commandButton.getOnClickAttribute());
          commandResult = (HtmlPage)commandButton.click();
        }

        //System.out.println("alerts size:"+collectedAlerts.size());
        //if(collectedAlerts.size() > 0){
          //for(int i=0; i<collectedAlerts.size(); i++){
View Full Code Here

          //System.out.println("got stmt0");
          stmt0.setChecked(true);
        }

        //check result
        HtmlButtonInput commandButton = (HtmlButtonInput)commandForm.getHtmlElementById("converterButton");
        HtmlPage commandResult = null;
        if(commandButton != null){
          //System.out.println("command button text:"+commandButton.asText());
          commandButton.focus();
          //System.out.println("command button script:"+commandButton.getOnClickAttribute());
          commandResult = (HtmlPage)commandButton.click();
        }

        //System.out.println("alerts size:"+collectedAlerts.size());
        //if(collectedAlerts.size() > 0){
          //for(int i=0; i<collectedAlerts.size(); i++){
View Full Code Here

        assertTrue(anchor.getHrefAttribute().contains("?name=Jack"));
    }
       
    @Test
    public void testButton() throws IOException {
        HtmlButtonInput button = (HtmlButtonInput)page.getElementById("button1");
        assertEquals("Login4", button.asText());
       
        HtmlPage output = button.click();
        assertEquals("HTTP GET (Login)", output.getTitleText());
    }
View Full Code Here

TOP

Related Classes of com.gargoylesoftware.htmlunit.html.HtmlButtonInput

Copyright © 2018 www.massapicom. 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.