0

Since upgrading to Geb 0.12.2 and Selenium 2.48.2, I cant get the following to work:

$("form").validOn(dateString)

I have tried variations like:

$("input",name:"validOn").value(dateString)

and

$("form").validOn << Keys.chord(Keys.CONTROL, "a")
$("form").validOn << Keys.chord(Keys.DELETE)
if(date){
  $("form").validOn << date
}

The element I am trying to set is using a jquery datepicker:

  <form class="form-inline">
        <label>Valid On:</label> 
        <input size="10" type="text"  id="datepicker-validOn" name="validOn" value="${validOn}">
...
   </form>
..
..
    <r:script type="text/javascript">

        $("#datepicker-validOn").datepicker({
            format:"${session.sessionPreferences?.globalDatepickerFormat}"
        });
...

The datepicker is opened which means that selecting the field works, but the string value is not placed inside the input field. I suspect that this has to do with the focus moving to the datepicker, but have not found a way to fix it. I tried having two .value(dateString) hoping that the second will return focus to the field but this has not worked. Also, the original html is not altered by the datepicker.

I am using firefox 33.1.1 This only happens on headless environment, using Hudson with Xvfb to run the functional tests. Running locally on desktop with same version of firefox works as expected, using this format : $("input",name:"validOn").value(dateString)

Any suggestions?

Giannis
  • 5,286
  • 15
  • 58
  • 113

1 Answers1

0

Changing the resolution for Xvfb from 1024x1024x24 to 1600x1200x24 has fixed the issue.. Not sure how this could affect the element focusing, but apparently it does.

Giannis
  • 5,286
  • 15
  • 58
  • 113