Selecting drop down shows error when it has div tag instead of select

when i try to select a value from drop down it shows error :

Test Cases/New Folder/NaukriReg FAILED because (of) Unable to select option by label ‘3’ of object ‘Object Repository/Page_Registration Jobs - Naukri.com (2)/div_dWrap’ using regular expression (Root cause: org.openqa.selenium.support.ui.UnexpectedTagNameException: Element should have been “select” but was “div”

Build info: version: ‘3.7.1’, revision: ‘8a0099a’, time: ‘2017-11-06T21:07:36.161Z’

System info: host: ‘USER-PC’, ip: ‘192.168.0.4’, os.name: ‘Windows 7’, os.arch: ‘amd64’, os.version: ‘6.1’, java.version: ‘1.8.0_102’

@“Tanaya Jena” : I think you are trying to call “selectOptionByValue” command.
And within your posted error message. The element you are trying to get value is not compatible with this keyword, so you should try to use other keyword instead.

Please help to provide more details your scenario and screenshot your HTML code of your element to see how other user help if you still confuse which keyword should be choose in your case.

Unknown said:

@“Tanaya Jena” : I think you are trying to call “selectOptionByValue” command.
And within your posted error message. The element you are trying to get value is not compatible with this keyword, so you should try to use other keyword instead.

Please help to provide more details your scenario and screenshot your HTML code of your element to see how other user help if you still confuse which keyword should be choose in your case.

Thanks for your response and i found solution for it .

Test Cases/Islambox_T FAILED because (of) Unable to de-select option by label ‘Miss’ of object ‘Object Repository/T_select option/Page_New User Registration/select_ctl00ctl00cphContentcph’ (Root cause: java.lang.UnsupportedOperationException: You may only deselect options of a multi-select)
please tell me about this error which i am getting whenever i want to use this keyword “Deselect option by label”

Hi there,

This error: “java.lang.UnsupportedOperationException: You may only deselect options of a multi-select” indicates that the SELECT control does not support multiple selections, so you can’t deselect multiple options from it. Please deselect only one option in this case.

You can refer to this exception from this page: https://github.com/SeleniumHQ/selenium/blob/master/java/client/src/org/openqa/selenium/support/ui/Select.java

Tanaya Jena said:

Unknown said:

@“Tanaya Jena” : I think you are trying to call “selectOptionByValue” command.
And within your posted error message. The element you are trying to get value is not compatible with this keyword, so you should try to use other keyword instead.

Please help to provide more details your scenario and screenshot your HTML code of your element to see how other user help if you still confuse which keyword should be choose in your case.

Thanks for your response and i found solution for it .

Hi, What was the solution of above problem? I am also facing the same issue

2 Likes

Tanaya Jena said:

Unknown said:

@“Tanaya Jena” : I think you are trying to call “selectOptionByValue” command.
And within your posted error message. The element you are trying to get value is not compatible with this keyword, so you should try to use other keyword instead.

Please help to provide more details your scenario and screenshot your HTML code of your element to see how other user help if you still confuse which keyword should be choose in your case.

Thanks for your response and i found solution for it .

Can you share that solution?