|
|
@ -197,6 +197,23 @@ def UIOSelector_Get_UIO (inSpecificationList,inElement=None):
|
|
|
|
lResult=lResultList[0]
|
|
|
|
lResult=lResultList[0]
|
|
|
|
return lResult
|
|
|
|
return lResult
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#################################################################################################
|
|
|
|
|
|
|
|
#Get process bitness (32 or 64)
|
|
|
|
|
|
|
|
#inSpecificationList - UIOSelector
|
|
|
|
|
|
|
|
#old name - None
|
|
|
|
|
|
|
|
#return None (if Process not found), int 32, or int 64
|
|
|
|
|
|
|
|
def UIOSelector_Get_BitnessInt (inSpecificationList):
|
|
|
|
|
|
|
|
lResult=None
|
|
|
|
|
|
|
|
#pdb.set_trace()
|
|
|
|
|
|
|
|
#Получить объект Application (Для проверки разрядности)
|
|
|
|
|
|
|
|
lRootElement=PWASpecification_Get_PWAApplication(inSpecificationList)
|
|
|
|
|
|
|
|
if lRootElement is not None:
|
|
|
|
|
|
|
|
if lRootElement.is64bit():
|
|
|
|
|
|
|
|
lResult=64
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
lResult=32
|
|
|
|
|
|
|
|
return lResult
|
|
|
|
|
|
|
|
|
|
|
|
##################################################################################################
|
|
|
|
##################################################################################################
|
|
|
|
#inControlSpecificationArray - List of dict, dict in pywinauto.find_windows notation
|
|
|
|
#inControlSpecificationArray - List of dict, dict in pywinauto.find_windows notation
|
|
|
|
#Backend selection - attribute "backend" ("win32" || "uia") in 1-st list element
|
|
|
|
#Backend selection - attribute "backend" ("win32" || "uia") in 1-st list element
|
|
|
@ -237,6 +254,41 @@ def PWASpecification_Get_UIO(inControlSpecificationArray):
|
|
|
|
for lWindowSpecification in inControlSpecificationArray[0:]:
|
|
|
|
for lWindowSpecification in inControlSpecificationArray[0:]:
|
|
|
|
lTempObject=lTempObject.window(**lWindowSpecification)
|
|
|
|
lTempObject=lTempObject.window(**lWindowSpecification)
|
|
|
|
return lTempObject
|
|
|
|
return lTempObject
|
|
|
|
|
|
|
|
##################################################################################################
|
|
|
|
|
|
|
|
#inControlSpecificationArray - List of dict, dict in pywinauto.find_windows notation
|
|
|
|
|
|
|
|
#Backend selection - attribute "backend" ("win32" || "uia") in 1-st list element
|
|
|
|
|
|
|
|
#return process application object
|
|
|
|
|
|
|
|
#old name - None
|
|
|
|
|
|
|
|
def PWASpecification_Get_PWAApplication(inControlSpecificationArray):
|
|
|
|
|
|
|
|
#Определение backend
|
|
|
|
|
|
|
|
lBackend=mDefaultPywinautoBackend
|
|
|
|
|
|
|
|
#pdb.set_trace()
|
|
|
|
|
|
|
|
if "backend" in inControlSpecificationArray[0]:
|
|
|
|
|
|
|
|
lBackend=inControlSpecificationArray[0]["backend"]
|
|
|
|
|
|
|
|
inControlSpecificationArray[0].pop("backend")
|
|
|
|
|
|
|
|
#Подготовка входного массива
|
|
|
|
|
|
|
|
inControlSpecificationOriginArray=inControlSpecificationArray
|
|
|
|
|
|
|
|
inControlSpecificationArray=UIOSelector_SearchProcessNormalize_UIOSelector(inControlSpecificationArray)
|
|
|
|
|
|
|
|
#Выполнить идентификацию объектов, если передан массив
|
|
|
|
|
|
|
|
lResultList=[];
|
|
|
|
|
|
|
|
lTempObject=None
|
|
|
|
|
|
|
|
if len(inControlSpecificationArray) > 0:
|
|
|
|
|
|
|
|
#Выполнить подключение к объекту
|
|
|
|
|
|
|
|
lRPAApplication = pywinauto.Application(backend=lBackend)
|
|
|
|
|
|
|
|
#Проверка разрядности
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
|
|
|
lRPAApplication.connect(**inControlSpecificationArray[0])
|
|
|
|
|
|
|
|
except Exception as e:
|
|
|
|
|
|
|
|
UIOSelector_TryRestore_Dict(inControlSpecificationArray)
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
|
|
|
lRPAApplication.connect(**inControlSpecificationArray[0])
|
|
|
|
|
|
|
|
except Exception as e:
|
|
|
|
|
|
|
|
lRPAApplication = None
|
|
|
|
|
|
|
|
if lRPAApplication is not None:
|
|
|
|
|
|
|
|
#lTempObject=lRPAApplication.window(**inControlSpecificationArray[0])
|
|
|
|
|
|
|
|
#Скорректировано из-за недопонимания структуры
|
|
|
|
|
|
|
|
lTempObject=lRPAApplication
|
|
|
|
|
|
|
|
return lTempObject
|
|
|
|
|
|
|
|
|
|
|
|
###########################################################################################################
|
|
|
|
###########################################################################################################
|
|
|
|
#inElementSpecificationList = UIOSelector (see description on the top of the document)
|
|
|
|
#inElementSpecificationList = UIOSelector (see description on the top of the document)
|
|
|
@ -945,7 +997,7 @@ if not mFlagIsDebug:
|
|
|
|
lJSONInput = ProcessCommunicator.ProcessParentReadWaitObject()
|
|
|
|
lJSONInput = ProcessCommunicator.ProcessParentReadWaitObject()
|
|
|
|
lProcessResponse["ActivitySpecificationDict"]=lJSONInput
|
|
|
|
lProcessResponse["ActivitySpecificationDict"]=lJSONInput
|
|
|
|
#Выполнить вызов функции
|
|
|
|
#Выполнить вызов функции
|
|
|
|
lProcessResponse["Result"]=JSONNormalize.JSONNormalizeDictList(locals()[lJSONInput['ActivityName']](*lJSONInput['ArgumentList'],**lJSONInput['ArgumentDict']))
|
|
|
|
lProcessResponse["Result"]=JSONNormalize.JSONNormalizeDictListStrInt(locals()[lJSONInput['ActivityName']](*lJSONInput['ArgumentList'],**lJSONInput['ArgumentDict']))
|
|
|
|
except Exception as e:
|
|
|
|
except Exception as e:
|
|
|
|
#Установить флаг ошибки
|
|
|
|
#Установить флаг ошибки
|
|
|
|
lProcessResponse["ErrorFlag"]=True
|
|
|
|
lProcessResponse["ErrorFlag"]=True
|
|
|
|