Forum Discussion

funmay's avatar
funmay
Contributor
6 years ago

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 w...
  • AlexKaras's avatar
    6 years ago

    Hi,

     

    The problem is that initially the page had a real 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 the .scrollIntoView() native DOM method), and click the found item.