BuiltInFunctions.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:Zeuz_Python_Node 作者: AutomationSolutionz 项目源码 文件源码
def Move_To_Element(step_data):
    try:
        sModuleInfo = inspect.stack()[0][3] + " : " + inspect.getmoduleinfo(__file__).name
        Element = LocateElement.Get_Element(step_data,selenium_driver)
        if Element != "failed":
            try:
                move = ActionChains(selenium_driver).move_to_element(Element).perform()
                CommonUtil.TakeScreenShot(sModuleInfo)
                CommonUtil.ExecLog(sModuleInfo, "Successfully moved to the middle of the element with given parameters and values", 1)
                return "passed"
            except Exception:
                element_attributes = Element.get_attribute('outerHTML')
                CommonUtil.ExecLog(sModuleInfo, "Element Attributes: %s"%(element_attributes),3)
                errMsg = "Could not move to your element your element."
                return CommonUtil.Exception_Handler(sys.exc_info(),None,errMsg)
        else:
            CommonUtil.ExecLog(sModuleInfo, "Unable to locate your element with given data.", 3)
            return "failed"   
    except Exception:
        return CommonUtil.Exception_Handler(sys.exc_info())


#Method to hover over element; step data passed on by the user
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号