Last active
December 21, 2015 05:19
-
-
Save prule/6255979 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| The facelets code uses the id "state" | |
| <p:selectOneMenu id="state" value="#{myBean.state}"> | |
| ... | |
| </p:selectOneMenu> | |
| */ | |
| // sample invocation to select element | |
| selectOne("myForm:state", "Disabled"); | |
| // select given option | |
| public void selectOne(String idPrefix, String value) { | |
| if (StringUtils.isNotBlank(value)) { | |
| getDriver().findElement(By.id(idPrefix + "_label")).click(); | |
| getDriver().findElement(By.xpath("//div[@id='" + idPrefix + "_panel']/div/ul/li[text()='" + value + "']")).click(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment