1 Reply Latest reply on Sep 29, 2010 5:13 AM by Nadya Staneva

    how to wait a combo rerender after loading data using ajax request Selenium test

    Nadya Staneva Newbie


      I have a problem testing a page with Selenium RC. I'm using RichFaces and I have a combo box for brand of car and another for chosing the model of the car, so the model depends on the brand and it rerenders after choosing the brand:


              <dx:inputCombo id="mps_model" required="true" value="#{policySelector.data.mps.model}"
                  label="#{msg.policies_mps_data_model}" selectItems="#{models}"
                  showEmptyElement="true" emptyElementLabel="#{msg.global_choose}"
                  <a4j:support event="onchange" action="selectBrand"
                      reRender="#{flowRenderFragments}" ajaxSingle="true"/>   


      So I have a combo box that loads data using ajax request and I need to select a value from the combo after it has loaded in order to test it with Selenium. I followed this article: http://blogs.nuxeo.com/dev/2009/03/selenium-ajax-requests.html and now it waits until the request has finished and then tries to select the value.


      The problem is that after the request has finished, the combo is not ready yet because it adds the options one by one and it takes additional time and Selenium clicks too fast . So the Selenium test fails because it tries to select an option which has not been loaded in the combo yet.

      Can you please tell me how to make it wait until the combo stops loading?