How to open a dropdown control
- 7 years ago
I tried the recording the tests using keyword test but the Gender Dropdown does not open when the recording is on.
After a few tries, I eventually found the solution. The DateTimePicker and the Generder Dropdown are wrapped inside a lot of control containers. The DateTimePicker control has two <Input> and they are inside multiple <div>, I must get the <input> with "class = 'dateTimePicker'" using XPath and then perform click() operation on this control to open the DateTimePicker; the Gender DropDown has multiple <span> controls, I must get the <span> with "Role = 'combobox'". When perform a "Click ()" on this control, it opens the dropdown.
The attached image has the two controls hightlighted in Red. I hope this may help someone who is puzzling on this type of issues.