def get_target_element(file_path, target_parameter, target_value, action_name, action_value, step_data):
'''
Function to get the target element(s) as per 'action'
'''
sModuleInfo = inspect.stack()[0][3] + " : " + inspect.getmoduleinfo(__file__).name
CommonUtil.ExecLog(sModuleInfo, "Function: get_target_element", 1)
try:
file_tree = []
#Function to get the XML file tree
file_tree = get_file_tree(file_path)
driver = None
driver = file_tree[0]
#Function to get the elements from the XML file
matching_elements = LE.Get_Element(step_data, driver)
CommonUtil.ExecLog(sModuleInfo, ">>> The expected attribute value is: '%s'" %action_value, 1)
#Function to update the target element
returned_target_element = update_target_element(file_path, file_tree[1], matching_elements, target_parameter, target_value, action_name, action_value)
return returned_target_element
except Exception:
return CommonUtil.Exception_Handler(sys.exc_info())
BuiltInFunctions_XML.py 文件源码
python
阅读 43
收藏 0
点赞 0
评论 0
评论列表
文章目录