Skip to content

Watir select list options should use watir elements #200

merged 1 commit into from Dec 18, 2013

2 participants

jkotests commented Dec 6, 2013

For Watir, the PageObject::Elements::Options returned by SelectList#[] and SelectList#options seem to be using the wrong underlying native element.

For example, for any page that has a select list, you can see that the underlying element of the select list is a Watir element (as expected):

p page.select_list_element.class
#=> PageObject::Elements::SelectList
p page.select_list_element.element.class
#=> Watir::Select

When you get select list's options using options, you can see that the underlying is a Selenium object (unexpected).

p page.select_list_element.options.first.class
#=> PageObject::Elements::Option
p page.select_list_element.options.first.element.class
#=> Selenium::WebDriver::Element

If instead you get an option using [], you can see that the underlying object is a PageObject object, which has an underlying Selenium object (unexpected).

p page.select_list_element[0].class
#=> PageObject::Elements::Option
p page.select_list_element[0].element.class
#=> PageObject::Elements::Option
p page.select_list_element[0].element.element.class
#=> Selenium::WebDriver::Element

Presumably, the underlying options should be using a Watir object.

I assume these methods were already under test, so I did not add any new tests.

@cheezy cheezy merged commit 41eaa5c into cheezy:master Dec 18, 2013

1 check failed

Details default The Travis CI build failed
@jkotests jkotests deleted the jkotests:watir-options-returns-wrong-native-element branch Jun 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.