cheezy / page-object

Gem to implement PageObject pattern in watir-webdriver and selenium-webdriver
MIT License
653 stars 220 forks source link

SelectList can not use `list_name=` while using Materializecss select dropdown #472

Closed happyjohnnylin closed 5 years ago

happyjohnnylin commented 5 years ago

Hi Cheezy,

I am using Materializecss for my web, and I have a select dropdown list whose options are added by jQuery. I can print out the options text using list_name_options, however, I don't know why I can't set the selected value using list_name=.

jkotests commented 5 years ago

The list_name= setter will only work with native select elements. From what I can tell from the demo site (https://materializecss.com/select.html), the default is not a native select. It's actually a text field with ul/lis.

You'll need to interact with the user visible fields - eg:

  1. Type into the text field
  2. Click the span with matching text

If you need help with doing this, please let me know.