6 Replies Latest reply on Feb 25, 2009 7:09 AM by ssilvert

    Having big problems with 1.1.0.GA-SNAPSHOT build

    kragoth

      I have the following code

      in my xhtml

      <gekko:commandButton
       id="reasonSelect"
       value="Select"
       action="#{CertificateCreateActionBean.selectReason}"
       rendered="#{CertificateCreateDataBean.certificate.reason == null}">
       <gekko:defaultAction />
      </gekko:commandButton>
      


      in my page driver
      public void clickReasonSelect(){
       click("reasonSelect");
      }
      


      in my test
      createPageDriver.clickReasonSelect();
      



      in the SEAM bean
       public String selectReason() {
       Certificate certificate = certificateCreateDataBean.getCertificate();
       if (certificate.getReason() == null) {
       FacesMessagesUtils.addErrorMessage(
       SEAM_ID + ".reason.mandatory",
       "Reason is mandatory");
       }
       else {
       GekkoDate dueDate = certificateDateService.calculateDueDate(
       dateService.getCurrentDate(),
       certificate.getReason().getDeliveryDays());
       certificate.setDueDate(dueDate);
       }
       return "";
       }
      


      Now after this button is clicked in my test my client has nothing in its html. When I do a getHtmlPageAsText() it is empty.

      I'll keep playing around but, has something really fundamental changed that I need to be aware of? Before upgrading to the latest build all my jsfunit tests were working fine.

      Thanks,
      Tim Evers


      P.S
      For the record. The <gekko:commandButton> is a straight extension of HtmlCommandButton to provide some application specific logic.

        • 1. Re: Having big problems with 1.1.0.GA-SNAPSHOT build
          kragoth

          Seems this is a htmlunit problem. I should have realised.

          I posted a few weeks back with a similar problem.
          http://www.jboss.org/index.html?module=bb&op=viewtopic&t=141467

          There is still a bug in htmlunit when clicking on commandButtons. I consistently end up with a blank client page.

          I am using a 2.4 snapshot of htmlunit that from what I can tell is from around 11/11/08. Somewhere after that changes were made that has made htmlunit stop working with commandButtons.


          I've still got a few more issues with upgrading to the jsfunit 1.1.0.GA-SNAPSHOT build but most of my tests are now working since i went back to my older htmlunit jar.

          • 2. Re: Having big problems with 1.1.0.GA-SNAPSHOT build
            kragoth

            Ok, so if I just upgrade my jsfunit jars I run into a problem with ajax.

            I have this xhtml

            <s:span>
             <gekko:textLookup
             id="lgaLookup"
             gekkoRequired="true"
             var="lga"
             valueLabel="#{lga.code}"
             label="Code"
             value="#{TenureKeyController.currentTenure.localGovernmentAuthority}"
             readonly="#{TenureKeyController.viewMode}"
             resolveEntryMethod="#{TenureMaintenanceController.findLgaWithCode}">
            
             <a4j:support
             event="onchange"
             reRender="lgaPanelGrid"
             bypassUpdates="false"
             focus="lgaLookupButton"
             oncomplete="hideProcessingPanel();" />
            
             </gekko:textLookup>
            
             <gekko:lookupButton
             id="lookupLgaButton"
             action="#{TenureMaintenanceController.selectLgaButtonClicked()}"
             style="border:none;"
             rendered="#{not TenureKeyController.viewMode}" />
            
             </s:span>
            


            gekko:textLookup is just a HtmlInputText component.

            So essentially I have a inpuText component with ajax support that fires on the "onchange" event. However, after executing the code that fills in this field the client.getPageAsText() is blank.

            This particular test worked fine in 1.0.0GA snapshot that I got a number of weeks back.



            • 3. Re: Having big problems with 1.1.0.GA-SNAPSHOT build
              kragoth

              A little more info.... I am finding this message in my logs.

              17:14:31.438 ERROR [http-8080-1] com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine - runtimeError: message=[innerHTML is read-only for tag table] sourceName=[http://localhost:8080/gekko-tje/a4j/g/3_2_2.GAorg.ajax4jsf.javascript.AjaxScript] line=[117] lineSource=[null] lineOffset=[0]
              


              not sure if it happens like this on the old version I'll keep trying stuff and see what I find.

              Remote debgging the application is becoming almost impossible now for some reason JSFUnit tests screw with Eclipse's debug.

              • 4. Re: Having big problems with 1.1.0.GA-SNAPSHOT build
                ssilvert

                I've seen that innerHtml message before. I asked about it on the htmlunit list and here is what Marc had to say:

                Setting innerHTML of a table doesn't work in IE and so does it HtmlUnit
                since release 2.3 (according to change log) when simulating IE.


                So maybe you could try it with Firefox?

                Stan

                • 5. Re: Having big problems with 1.1.0.GA-SNAPSHOT build
                  kragoth

                  I'm a little confused by the quote from Marc.

                  Does this mean that I have to run all my tests in FireFox mode because IE mode doesn't support this operation? Or is this a known bug they have that they plan on fixing?

                  Because obviously my application is running fine on IE as that is our target delivery platform. Hence why I was using IE mode for my testing. (Or at least trying to.)

                  I'll hopefully spend a bit more time trying to upgrade the libraries in the next few days, but it is becoming a painful process.

                  • 6. Re: Having big problems with 1.1.0.GA-SNAPSHOT build
                    ssilvert

                    I took it to mean that IE doesn't support setting innerHtml of a table, so they make it behave accordingly. Something is obviously screwed up with that since your app does run on IE.

                    I'm going on vacation for the rest of the week, but if you want to ping Marc at the HtmlUnit list and get back to me I'll try to check back in and see what I can do to help.

                    Stan