jquery - geb/selenium test, chosen multiple selection -
i want test multiple selection realized via jquery plugin called chosen.
the html of selection:
<select id="pickusers" name="users" multiple="true" class="many-to-many" > <option value="1" >me</option> <option value="3" >leader</option> <option value="2" >test</option> </select>
exception is:
org.openqa.selenium.elementnotvisibleexception: element not visible , may not interacted
i think has todo display: none
css property , read alot didnt find solution problem
edit:
my selenium bindings are:
users {$("select", name:"users")}
i tried several assignments:
users = ["me", "test"] or users = [1,2,3] users = ["1","2","3"]
ran same issue. geb can access elements visible. in case, chosen adds display none select (<select ... style="display:none">
). therefore cannot access using $('')
selector.
one workaround is:
in test:
remove style attribute.
js.exec("document.getelementsbytagname('select')[0].removeattribute('style')")
this way think of since geb has getattribute
$('')
selectors, not have setattribute.set new select value value
$('select').value(1)
note: it's not elegant solution since you'll 2 selects. first "unhide", , second 1 created , styled chosen. nevertheless way can access select, set value move on testing.
Comments
Post a Comment