Jump to content

Recommended Posts

Posted

I'm using the UIA Spy Tool (as I do quite often now) to aide in some IE Automation. The Spy Tool can detect the window, elements, etc. just like normal, but my script to control this window will not work. It works fine on the previous windows within the program, just not this one. Any help here would be appreciated. Thanks.

My Script Shown below:

; Create UI Automation object

Local $oUIAutomation = ObjCreateInterface( $sCLSID_CUIAutomation, $sIID_IUIAutomation, $dtagIUIAutomation )

; Get Desktop element

  Local $pDesktop, $oDesktop
  $oUIAutomation.GetRootElement( $pDesktop )
  $oDesktop = ObjCreateInterface( $pDesktop, $sIID_IUIAutomationElement, $dtagIUIAutomationElement )
  
  ; --- Find Report Criteria Screen ---

Local $pCondition3
$oUIAutomation.CreatePropertyCondition( $UIA_NamePropertyId, "FIS ODB Report Criteria Screen - Internet Explorer provided by Ford Motor Company", $pCondition3 )

Local $pWindow3, $oWindow3
$oDesktop.FindFirst( $TreeScope_Descendants, $pCondition3, $pWindow3 )
$oWindow3 = ObjCreateInterface( $pWindow3, $sIID_IUIAutomationElement, $dtagIUIAutomationElement )

; --- Click Template Drop Down ---

Local $pCondition4
$oUIAutomation.CreatePropertyCondition( $UIA_NamePropertyId, "Open", $pCondition4 )


Local $pButton1, $oButton1
$oWindow3.FindFirst( $TreeScope_Descendants, $pCondition4, $pButton1 )
$oButton1 = ObjCreateInterface( $pButton1, $sIID_IUIAutomationElement, $dtagIUIAutomationElement )

$oButton1.Invoke()

 

UIA.png

UIA Error.png

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
  • Recently Browsing   0 members

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