From 8e3efdf356c9da1b21060093d84ef7dcb558e9fc Mon Sep 17 00:00:00 2001 From: Nico Schedel Date: Tue, 21 Jan 2020 12:14:43 +0100 Subject: [PATCH] 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 --- t/selenium/functions/Functions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/selenium/functions/Functions.py b/t/selenium/functions/Functions.py index 1b92017a..4b7b13e6 100644 --- a/t/selenium/functions/Functions.py +++ b/t/selenium/functions/Functions.py @@ -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)