Showing results for 
Search instead for 
Did you mean: 

Select drop down problems

Occasional Contributor

Select drop down problems

I am having problem to select a drop down item with ClickItem(), it was working before until the tags "select and option" have been replaced with "div".

It was  working with these below html tags with select and options


<select id='dropDownMenu'>
  <option value='foo'>Title1</option>
  <option value='bar'>Title2</option>

but it is not working with the below example for the html  

<div id='dropDownMenu'>
  <div value='foo'>Title1</div>
  <div value='bar'>Title2</div>

Could you please let me know if there is any other method to select the dropdown without using the ClickItem() 

Community Hero

Re: Select drop down problems



The problem is that initially the page had a read dropdown with a set of its items. Thus .SelectItem() method worked.

Now your page does not have any dropdown but has just a set of unrelated div elements. They are interacting like dropdown only due to some page script code, but not because the browser renders and handle them as a dropdown.

Your only option is to implement a new test code that will search for the new 'dropdown' (by the value of id, for example) and click the found object in order to 'open' the 'list of dropdown values'. Then the code must search for the required child div, scroll it into view if the found item is not visible on the screen (this can be done with the help of .scrollIntoView() native DOM method), and click the found item.


[Community Expert Group]
[Community Expert Group] members are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Postings made by [Community Expert Group] members
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
[Community Expert Group] signature is used with permission by SmartBear Software.
2018 NEWS
Top Kudoed Authors