Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions Framework/Built_In_Automation/Shared_Resources/LocateElement.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,14 @@ def Get_Element(step_data_set, driver, query_debug=False, return_all_elements=Fa
if save_parameter != "": # save element to a variable
sr.Set_Shared_Variables(save_parameter, result)
return result # Return on pass
elif result == "zeuz_failed":
try:
if len(generic_driver.find_elements(By.TAG_NAME, "iframe")) > 0:
CommonUtil.ExecLog(sModuleInfo, "You have Iframes in your Webpage. Try switching Iframe with \"Switch Iframe\" action", 3)
elif len(generic_driver.find_elements(By.TAG_NAME, "frame")) > 0:
CommonUtil.ExecLog(sModuleInfo, "You have Frames in your Webpage. Try switching Frame with \"Switch Iframe\" action", 3)
except:
pass
return "zeuz_failed"
except Exception:
return CommonUtil.Exception_Handler(sys.exc_info())
Expand Down Expand Up @@ -786,12 +794,12 @@ def _get_xpath_or_css_element(element_query, css_xpath,data_set, index_number=No

if all_matching_elements_visible_invisible and len(filter_elements(all_matching_elements_visible_invisible, "")) > 0:
break
elif time.time() > end:
if time.time() > end:
break
# end of while loop

if exception_cnd:
return False
return "zeuz_failed"

if driver_type == "appium" and index_number is not None and index_number > 0 and len(all_matching_elements_visible_invisible) == 0:
CommonUtil.ExecLog(sModuleInfo, "Element not found and we do not support Auto Scroll when index is provided", 2)
Expand Down Expand Up @@ -830,7 +838,7 @@ def _get_xpath_or_css_element(element_query, css_xpath,data_set, index_number=No
"To get hidden elements add a row (\"allow hidden\", \"optional option\", \"yes\")",
3
)
return False
return "zeuz_failed"
elif len(all_matching_elements) == 1 and index_number is None:
if hidden_len > 0 and Filter != "allow hidden":
CommonUtil.ExecLog(
Expand Down