Hi,I have created test case to select item from dropdown list. but it gives error

I have created test case using ‘Select Option By Index’ but giving error - “Verification FAILED because (of) Unable to select option by index ‘103’ of object ‘Page_eAIP Admin/select_–Select Department–de’ (Root cause: java.lang.IllegalArgumentException: Index ‘103’ is invalid (valid indexes are: [0…10]))”

Please help me to solve this issue


you are trying to get option by index 103, but it seems you have only 11 options (0-10). More info here

selectOptionByIndex() is using array of possible choices - so if you have 11 choices index will be from 0 to 10. I guess you want to select choice with value of 103 try to use selectOptionByValue()

Thank you guys, its working now. By Value and By Index also.