We could replace it with something like:
{{{
def select_option(self, select_tag_css_selector, value):
from selenium.webdriver.support.ui import Select
select =
Select(self.selenium.find_element_by_css_selector(select_tag_css_selector))
select.select_by_value(value)
}}}
This would avoid looping over the DOM-tree as it's done in the current
implementation.
Furthermore, it can avoid errors when a select-tag is outside the current
viewport.
--
Ticket URL: <https://code.djangoproject.com/ticket/30975>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* has_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/30975#comment:1>
* needs_better_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/30975#comment:2>
* stage: Unreviewed => Accepted
Comment:
OK. Sounds good. — Thanks again! (Will review all three tickets next
week.)
--
Ticket URL: <https://code.djangoproject.com/ticket/30975#comment:3>
* keywords: => Selenium
--
Ticket URL: <https://code.djangoproject.com/ticket/30975#comment:4>
* needs_better_patch: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/30975#comment:5>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/30975#comment:6>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"249a6190aef5e3676c6d9aa6c38cecff895b5993" 249a6190]:
{{{
#!CommitTicketReference repository=""
revision="249a6190aef5e3676c6d9aa6c38cecff895b5993"
Fixed #30975 -- Replaced custom get_select_option with Selenium's
select_by_value.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/30975#comment:7>