We have an application based on RichFaces 3.3.3 . We have created automated tests with Selenium IDE that run fine. Since the RichFaces comboboxes are not real html comboboxes but an input field with a bunch of javascript, in Selenium we need to select a value with the following trick:
type field_id "field value"
typeKeys field_id "field value"
fireEvent field_id "blur"
In order to integrate the tests into our continuous integration system, we have transformed the test to jUnit tests that use WebDriver (Selenium 2.5.0) as the backend. Unfortunately the combobox trick stopped working.
All type and typeKeys commands are translated as shown below:
// ERROR: Caught exception [ERROR: Unsupported command [fireEvent]]
driver.findElement(By.id("patientCreateDataForm:patientBirthDateInputDate")).clear();
driver.findElement(By.id("patientCreateDataForm:patientBirthDateInputDate")).sendKeys("16.06.1910");
Does anyone have any working solution to test RichFaces combobox elements?
Thanks in advance!
The solution is as follows:
thereafter use Actions method in jUnit test. In the following example, button parameter is a combobox button id, element parameter is selected items xpath: