Jump to content

IUI Check if object Exists


Recommended Posts

I'm trying to set up a thing where if row0attachment exists in a program then it reads from and excel. It does not find the object correctly. What am I doing wrong?

_UIA_setVar("row0attachment","Title:=(Value=(.*)# Row=0 Column=File Name);controltype:=UIA_TextControlTypeId")

local $orow0attachment=_UIA_getObjectByFindAll("title:=Value=(.*)# Row=0 Column=File Name;ControlType:=UIA_TextControlTypeId", $treescope_subtree)

If IsObj($orow0attachment) Then
   local $Attachment1 = _Excel_RangeRead($oExcel, Default, "C2")
   local $Attachment1type = _Excel_RangeRead($oExcel, Default, "D2")
EndIf

Think i fixed it with

local $orow0attachment=_UIA_getObject("title:=Value=(.*)# Row=0 Column=File Name;ControlType:=UIA_TextControlTypeId")

Edited by milkmoron
Link to comment
Share on other sites

_UIA_setVar("oP1","Title:=View Activity;controltype:=UIA_WindowControlTypeId;class:=WindowsForms10.Window.8.app.0.30495d1_r9_ad1")  ;View Activity
_UIA_setVar("oP2","Title:=;controltype:=UIA_PaneControlTypeId;class:=WindowsForms10.Window.8.app.0.30495d1_r9_ad1") ;
_UIA_setVar("oP3","Title:=Group Type:;controltype:=UIA_PaneControlTypeId;class:=WindowsForms10.Window.8.app.0.30495d1_r9_ad1")  ;Group Type:
_UIA_setVar("oP4","Title:=Delete;controltype:=UIA_PaneControlTypeId;class:=WindowsForms10.Window.8.app.0.30495d1_r9_ad1")   ;Delete
_UIA_setVar("oP5","Title:=DevExpressGrid:5;controltype:=UIA_DataGridControlTypeId;class:=WindowsForms10.Window.8.app.0.30495d1_r9_ad1") ;DevExpressGrid:5
_UIA_setVar("oP6","Title:=grdActivityView_ActViewGrdAttachments-XGDataRow4;controltype:=UIA_DataItemControlTypeId;class:=") ;grdActivityView_ActViewGrdAttachments-XGDataRow4

;~ $oUIElement=_UIA_getObjectByFindAll("Value=image004#Row=4Column=FileName.mainwindow", "title:=Value=image004# Row=4 Column=File Name;ControlType:=UIA_TextControlTypeId", $treescope_subtree)
_UIA_setVar("oUIElement","Title:=Value=image004# Row=4 Column=File Name;controltype:=UIA_TextControlTypeId;class:=image004") ;ControlType:=UIA_TextControlTypeId;classname:=image004")

;~ Actions split away from logical/technical definition above can come from configfiles 

;~_UIA_Action("oP1","highlight")
_UIA_Action("oP1","setfocus")
;~_UIA_Action("oP2","highlight")
_UIA_Action("oP2","setfocus")
;~_UIA_Action("oP3","highlight")
_UIA_Action("oP3","setfocus")
;~_UIA_Action("oP4","highlight")
_UIA_Action("oP4","setfocus")
;~_UIA_Action("oP5","highlight")
_UIA_Action("oP5","setfocus")
;~_UIA_Action("oP6","highlight")
_UIA_Action("oP6","setfocus")

_UIA_action("oUIElement","highlight")
;~_UIA_action("oUIElement","click")

I got it to work buy its pretty slow.

Edited by milkmoron
Link to comment
Share on other sites

Slow means in general you have to give a better description for recognizing. The wrapper tries to fallback to different searching alternatives which costs time. You can get more speed by using the interfaces directly if you favor speed over easier usage.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...