Element should have been “select” but was “div” getting an error in selenium

前端 未结 3 1881
广开言路
广开言路 2020-12-07 06:07

Here is the HTML code, i\'m trying to select \'select customer\' drop-down.

3条回答
  •  南笙
    南笙 (楼主)
    2020-12-07 06:36

    This exception generally occurs when we use Select command to select dropdowns which are not built by using "select" tag.

    You can try by using sendkeys to select dropdown, just give displayed text of option in sendkeys.

    If above does not work, then go for click on dropdown and again click on required option.

    If it is auto complete dropdown, then click on that dropdown input box and go for senkeys char by char with small sleep, so that required option will be displayed.

提交回复
热议问题