From ab53f8860f676c26fb11cdf5dec36e219e25aab8 Mon Sep 17 00:00:00 2001 From: Ivan Maslov Date: Sat, 8 Jun 2019 18:43:30 +0300 Subject: [PATCH] #UIOSelector raise Error if Element not found (like a same pywinauto error) #WebHightlight = FocusHighlight --- Robot/GUI.py | 2 ++ Studio/Web/Index.xhtml | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Robot/GUI.py b/Robot/GUI.py index 47b49615..191971ac 100644 --- a/Robot/GUI.py +++ b/Robot/GUI.py @@ -195,6 +195,8 @@ def UIOSelector_Get_UIO (inSpecificationList,inElement=None): lResultList=UIOSelector_Get_UIOList(inSpecificationList,inElement) if len(lResultList)>0: lResult=lResultList[0] + else: + raise pywinauto.findwindows.ElementNotFoundError("Robot can't find element by the UIOSelector") return lResult ################################################################################################# diff --git a/Studio/Web/Index.xhtml b/Studio/Web/Index.xhtml index f9c5f415..c1d9abba 100644 --- a/Studio/Web/Index.xhtml +++ b/Studio/Web/Index.xhtml @@ -247,7 +247,7 @@ var lElementId = mGlobal.GenerateUniqueID() var lSubItemHandleId=lResponseJSON.Result[i].handle; var lSubItemActionOnClick=' onclick="mGlobal.TreeLoadSubTree(\''+lElementId+'\');" ' - var lSubItemActionOnRightClick=' oncontextmenu="mGlobal.ElementHighlightNew(\''+lElementId+'\');" ' + var lSubItemActionOnRightClick=' onclick="mGlobal.ElementHighlightNew(\''+lElementId+'\');" ' var lIconSelectOnClick=' onclick="mGlobal.TreeObjectInfoLoad(\''+lElementId+'\');" ' var lIconTestOnClick=' onclick="mGlobal.Test(\''+lElementId+'\');" ' var lIconUpOnClick=' onclick="mGlobal.Actions.fAutomationSearchMouseElementHierarchyRun(\''+lElementId+'\');" ' @@ -394,7 +394,7 @@ $.ajax({ type: "POST", url: 'GUIAction', - data: '{"ModuleName":"GUI","ActivityName":"UIOSelector_Highlight","ArgumentList":['+JSON.stringify(lSpecificationArray)+']}', + data: '{"ModuleName":"GUI","ActivityName":"UIOSelector_FocusHighlight","ArgumentList":['+JSON.stringify(lSpecificationArray)+']}', success: function(lData,l2,l3) {