TT#70901 selenium: fix "if element is xpath" check

- elements that start with "/html" for example wouldnt get picked up since
they only use 1 slash while the check was expecting 2 slashes

Change-Id: I787f8914744e7b8337b27389a6a4257873c4d399
changes/86/36986/1
Nico Schedel 5 years ago
parent cfffccccd2
commit 8e3efdf356

@ -16,7 +16,7 @@ def fill_element(driver, element, text, pathtype=By.XPATH):
def scroll_to_element(driver, element):
if element[:2] == "//":
if element[:1] == "/":
webelem = driver.find_element_by_xpath(element)
else:
webelem = driver.find_element_by_link_text(element)
@ -36,7 +36,7 @@ def move_and_click(driver, element, clickelement=None):
def click_js(driver, element):
if element[:2] == "//":
if element[:1] == "/":
webelement = driver.find_element_by_xpath(element)
else:
webelement = driver.find_element_by_link_text(element)

Loading…
Cancel
Save