I am doing some integration tests with vaadin version 7.6.4 and Testbench (4.0.3).
I have a view with several comboboxes. One of them has this property comboBox.setTextInputAllowed(false);
For testing purposes, I want to change the default value on the combobox and I need to select a different element then the default one.
To select an element I have tried the following code:
$(ComboBoxElement.class).selectByText("ElementName");
But this only works when comboBox.setTextInputAllowed(true);
I also have tried to use sendkeys()
to change the selected value:
$(ComboBoxElement.class).openPopup();
$(ComboBoxElement.class).sendKeys(keys.ARROW_DOWN);
$(ComboBoxElement.class).endKeys(Keys.ENTER);
This code opens the comboBox popup correctly but doesn't select any item. Neither if I set the focus with setFocus()
;
Could anybody please tell me how can I change the value of a combobox with property setTextInputAllowed(false)
?.