0

I'm writing some Geb test for a form. For some reason I can't hit any of the dropdowns in my form.

Example field:

<div class="col-sm-2">
    State<g:select name="submitterState" from="stuff..." class="form-control" optionKey="id" required="" value=""/>
</div>

I've written the test itself three different ways and none of them hit the select. Where 102727 is one of the values of the dropdown.

$('#submitterState').value(102727)
$("form").submitterState = 102727
$('select', name: 'submitterState').value(102727)

Do I have something wrong with my test, or is there something behind it I'm not seeing? -r

ry1633
  • 453
  • 1
  • 10
  • 24

1 Answers1

1

First of all, can you select a property with '#'? '#' is used to select an id.

I think you should pass a string instead of an integer.

$('#submitterState').value('102727')

But this will not work. You should try something like this:

$('div.col-sm-2').find('select', name: 'submitterState').value('102727')

Hope, your problem will be solved!

Sharif Mamun
  • 3,508
  • 5
  • 32
  • 51
  • sorry I haven't got back to you sooner. I never got around to working on that piece again. What you suggested did not work for me. Are there any other ideas? – ry1633 Sep 19 '14 at 20:32