I recently had to investigate how to generate a PDF from a Crystal Report created by another team. Without knowing anything about Crystal Reports, I had to google around for information and piece it all together. It turns out to be really simple once you know how.
I'm using JBehave with Selenium WebDriver to test my PrimeFaces (JSF2) application. Selecting an option from a SelectOne option list isn't standard though because of the HTML markup generated by the JSF component.
The facelets code to place the selectOneMenu uses the ID 'state':
This generates HTML div blocks with id's prefixed with this components id:
To select an option, I use a method which manipulates the appropriate divs - this can be used as illustrated below:
To reuse this type of utility method, I put it in a base Page Object class: