Skip to content

Commit 4f24428

Browse files
committed
Add method: convert_css_to_xpath()
1 parent 664df49 commit 4f24428

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

seleniumbase/fixtures/base_case.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ def test_anything(self):
4545
from seleniumbase.core import log_helper
4646
from seleniumbase.core import tour_helper
4747
from seleniumbase.fixtures import constants
48+
from seleniumbase.fixtures import css_to_xpath
4849
from seleniumbase.fixtures import js_utils
4950
from seleniumbase.fixtures import page_actions
5051
from seleniumbase.fixtures import page_utils
@@ -1429,8 +1430,8 @@ def __select_option(self, dropdown_selector, option,
14291430
timeout = settings.SMALL_TIMEOUT
14301431
if self.timeout_multiplier and timeout == settings.SMALL_TIMEOUT:
14311432
timeout = self.__get_new_timeout(timeout)
1432-
if page_utils.is_xpath_selector(dropdown_selector):
1433-
dropdown_by = By.XPATH
1433+
dropdown_selector, dropdown_by = self.__recalculate_selector(
1434+
dropdown_selector, dropdown_by)
14341435
self.wait_for_ready_state_complete()
14351436
element = self.wait_for_element_present(
14361437
dropdown_selector, by=dropdown_by, timeout=timeout)
@@ -2984,6 +2985,9 @@ def get_google_auth_password(self, totp_key=None):
29842985
totp = pyotp.TOTP(totp_key)
29852986
return str(totp.now())
29862987

2988+
def convert_css_to_xpath(self, css):
2989+
return css_to_xpath.convert_css_to_xpath(css)
2990+
29872991
def convert_xpath_to_css(self, xpath):
29882992
return xpath_to_css.convert_xpath_to_css(xpath)
29892993

0 commit comments

Comments
 (0)