0 Replies Latest reply on Jul 27, 2012 2:32 AM by Ellie Fabrero

    Rich:modalPanel is not displayed while invoking a ajax button in jsfUnit.

    Ellie Fabrero Newbie

      Hi everyone,

       

      I'm currently running a simple jsf unit in my web application. I'm using jsf1.2 richfaces 3 and seam.

      I have a modal to displayed when a button is hit. I'm checking the elements inside the modal if it is displayed using the HtmlSelect isDisplayed(); method but unfortunately i am receiving assertion error

      on it.

       

      Here is my sample code:

       

              HtmlSelect mSelection = (HtmlSelect) client.getElement("selecID");
              assertTrue
      ( mSelection.isDisplayed() );
              assertFalse
      ( mSelection.isDisabled() );

             
      HtmlOption mOption = mOption .getOptionByValue("18");
              mOption
      .setSelected(true);
             
      try {
                  mOption
      .click();
             
      } catch (IOException e2) {
                  e2
      .printStackTrace();
             
      }

             
      System.out.println(" SELECTED = " + mOption .getText());       
              
      HtmlButtonInput goButton = (HtmlButtonInput) client.getElement("goButton");
              assertTrue
      ( goButton.isDisplayed() );
              assertFalse
      ( goButton.isDisabled() );

                    

                        HtmlPage page = null;

              try {
                 
      page = goButton.click();

             
      } catch (IOException e) {
             
      }

             
      try {
                 
      Thread.sleep(10000);

             
      } catch (InterruptedException e1) {   
                  e1
      .printStackTrace();
             
      }

                 
      //This part is inside the modal
             
      HtmlSelect mmSetSelection = (HtmlSelect)
      page.getElementById("mmSelection");
              assertTrue
      ( mmSetSelection!= null );

             
      System.out.println(" IS DISABLED? = " + mmSetSelection.isDisplayed() );

       

      What am i missing here? Thanks.