Jump to content

Recommended Posts

Posted

The following code...

#include <ie.au3>

Local $hLogOff = WinWait("SIEMENS Soarian® Automatic Logoff -- Webpage Dialog")
If IsHWnd($hLogOff) = 0 Then
    TrayTip('$hLogOff', 'Is not HWnd', 100)
Else
    $oIELogOff = _IEAttach($hLogOff, 'DialogBox')
    ConsoleWrite(@CRLF)
    ConsoleWrite('===============================================')
    ConsoleWrite(@CRLF)
    $sHTML = _IEPropertyGet($oIELogOff, "outerhtml")
    ClipPut($sHTML)
    ConsoleWrite($sHTML)
    ConsoleWrite(@CRLF)
    ConsoleWrite('===============================================')
    ConsoleWrite(@CRLF)
EndIf

...produced the following output...

 
===============================================
 
<BODY class=pgBody onunload=terminate() onload=windowOnload(); scroll=no><LINK rel=stylesheet href="/dynamic/uia/style/uia/sui_msgDialog.css?v=05050708">
<SCRIPT language=javascript src="/dynamic/soarian/sframe/sframeAutomaticLogoff.js?v=05050708"></SCRIPT>
 
<TABLE class=hw100 border=0 cellSpacing=0 cellPadding=0>
<TBODY>
<TR>
<TD class=mainBody>
<TABLE border=0 cellSpacing=0 cellPadding=0 width="100%" height="100%">
<TBODY>
<TR>
<TD id=imgTD class=iconHeader vAlign=top width="1%"><IMG id=msgImg src="/dynamic/uia/img/uia/sui_warning.gif"></TD>
<TD class=textHeader vAlign=top align=left>
<DIV style="PADDING-BOTTOM: 20px" id=msgDiv class=oflowAuto>You will be automatically logged off in&nbsp; <SPAN id=numberOfSecondsSpan>15</SPAN>&nbsp; seconds.<BR><BR>Click OK to prevent an automatic logoff.</DIV></TD></TR></TBODY></TABLE></TD></TR>
<TR id=btnRow>
<TD class=footer align=middle><SPAN style="VISIBILITY: visible" id=ctlokBtn class=IccButtonNoBorder iccELEM="CO"><BUTTON style="VISIBILITY: visible" id=ctlokBtnButton__ class=IccButtonGradient iccVector="0,1,,IccButtonGradient,IccButtonGradientDisabled,IccButtonLatched,IccButtonNoBorder,IccButtonGradientDown" class="IccButtonGradient">OK</BUTTON> </SPAN></TD></TR></TBODY></TABLE></BODY>
===============================================
Posted (edited)

Try it with the logic as can be found here

'?do=embed' frameborder='0' data-embedContent>>

#include "UIAWrappers.au3"

#AutoIt3Wrapper_UseX64=N

;~ Set the system under test UID objects to recognize
local $UID_IEDialog[2][2] = [ _
["mainwindow","SIEMENS.*Dialog"], _
["btnOk","name:=Ok"] _
]
_UIA_setVarsFromArray($UID_IEDialog,"IEDialog.")


;~ To be moved to 1 or multiple scriptfiles
;- Set the script
;~ The actual script, 50,10 is only there if a lot of lines and parameters are needed

local $script[50][10]= [ _
["IEDialog.Mainwindow","setfocus"], _
["IEDialog.btnOk",   "click"] _
]

_UIA_launchScript($script)

Exit
Edited by junkew
Posted

do this woks?

#include <IE.au3>
$hLogOff = WinWait("SIEMENS Soarian® Automatic Logoff -- Webpage Dialog")
$oIELogOff = _IEAttach($hLogOff, 'DialogBox')
$oSubmit = _IEGetObjByID($oIELogOff, "ctlokBtnButton__")
_IEAction ($oSubmit, "click")

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)

  Reveal hidden contents


460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 
Posted
  On 11/23/2013 at 9:27 AM, junkew said:

 

Try it with the logic as can be found here

'?do=embed' frameborder='0' data-embedContent>>

#include "UIAWrappers.au3"

#AutoIt3Wrapper_UseX64=N

;~ Set the system under test UID objects to recognize
local $UID_IEDialog[2][2] = [ _
["mainwindow","SIEMENS.*Dialog"], _
["btnOk","name:=Ok"] _
]
_UIA_setVarsFromArray($UID_IEDialog,"IEDialog.")


;~ To be moved to 1 or multiple scriptfiles
;- Set the script
;~ The actual script, 50,10 is only there if a lot of lines and parameters are needed

local $script[50][10]= [ _
["IEDialog.Mainwindow","setfocus"], _
["IEDialog.btnOk",   "click"] _
]

_UIA_launchScript($script)

Exit

This code produced an error...

Line 4773

"Error: Array variable has incorrect number of subscripts or subscript dimension range exceeded."

Posted
  On 11/23/2013 at 7:11 PM, bogQ said:

 

do this woks?

#include <IE.au3>
$hLogOff = WinWait("SIEMENS Soarian® Automatic Logoff -- Webpage Dialog")
$oIELogOff = _IEAttach($hLogOff, 'DialogBox')
$oSubmit = _IEGetObjByID($oIELogOff, "ctlokBtnButton__")
_IEAction ($oSubmit, "click")

 

This did not work.

Posted
  On 11/25/2013 at 4:15 PM, dleonard said:

This did not work.

Any console output ?

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted (edited)

  On 11/25/2013 at 4:15 PM, dleonard said:

This code produced an error...

 

Line 4773

 

"Error: Array variable has incorrect number of subscripts or subscript dimension range exceeded."

'?do=embed' frameborder='0' data-embedContent>>

 

In the first post there is a simply spy.

Hover over the popup and post the contents of the spy

do the same for the button

 

Is there any public website where we can see a comparable example of what you are trying to accomplish? Can you create a dummy standalone HTML page to reproduce the popup you show

 

for example if I have on Autoit the full editor and choose to insert code I get a similar overlay/popup

which I identify as

Title is: <Code> Class   := <> controltype:= <UIA_CustomControlTypeId> ,<50025> , (0000C369)

and the Ok button

Title is: <OK> Class   := <> controltype:= <UIA_ButtonControlTypeId> ,<50000> , (0000C350)

 

In its most simplified form this can lead to this code (the other example was especially for when you create larger scripts)

#include "UIAWrappers.au3" 

#AutoIt3Wrapper_UseX64=N

_UIA_Action("name:=Code; controltype:=Custom", "setfocus")
_UIA_Action("name:=OK;controltype:=Button;instance:=2", "click")
To have above working you have to patch a little in UIAWrappers.AU3

$startElement="RTI." & stringleft($obj_or_string,stringinstr($obj_or_string,".")) & "mainwindow"
                $oStart=_UIA_getVar($startElement)
;~              if isobj($oStart) Then
;~                  _UIA_DEBUG("Its an object ")
;~              Endif
should become

 

$startElement="RTI." & stringleft($obj_or_string,stringinstr($obj_or_string,".")) & "mainwindow"
                $oStart=_UIA_getVar($startElement)
                if isobj($oStart) Then
;~                  _UIA_DEBUG("Its an object ")
                Else
                    $oStart=$oDesktop
                endif
Edited by junkew
Posted

  On 11/26/2013 at 8:23 PM, junkew said:

'?do=embed' frameborder='0' data-embedContent>>

 

In the first post there is a simply spy.

Hover over the popup and post the contents of the spy

 

Here are the "spy" results from the popup window...

 

Mouse position is retrieved 809-453
At least we have an element [][]
Having the following values for all properties: 
Title is: <> Class   := <> controltype:= <UIA_TitleBarControlTypeId> ,<50037> , (0000C375)
*** Parent Information ***
Title is: <SIEMENS Soarian® Automatic Logoff -- Webpage Dialog> Class   := <Internet Explorer_TridentDlgFrame> controltype:= <UIA_WindowControlTypeId> ,<50032> , (0000C370)
*** Detailed properties of the highlighted element ***
UIA_AcceleratorKeyPropertyId :=
UIA_AccessKeyPropertyId :=
UIA_AriaPropertiesPropertyId :=
UIA_AriaRolePropertyId :=
UIA_AutomationIdPropertyId :=
UIA_BoundingRectanglePropertyId :=693;453;325;26
UIA_ClassNamePropertyId :=
UIA_ClickablePointPropertyId :=
UIA_ControllerForPropertyId :=
UIA_ControlTypePropertyId :=50037
UIA_CulturePropertyId :=0
UIA_DescribedByPropertyId :=
UIA_DockDockPositionPropertyId :=5
UIA_ExpandCollapseExpandCollapseStatePropertyId :=3
UIA_FlowsToPropertyId :=
UIA_FrameworkIdPropertyId :=
UIA_GridColumnCountPropertyId :=0
UIA_GridItemColumnPropertyId :=0
UIA_GridItemColumnSpanPropertyId :=1
UIA_GridItemContainingGridPropertyId :=
UIA_GridItemRowPropertyId :=0
UIA_GridItemRowSpanPropertyId :=1
UIA_GridRowCountPropertyId :=0
UIA_HasKeyboardFocusPropertyId :=False
UIA_HelpTextPropertyId :=
UIA_IsContentElementPropertyId :=False
UIA_IsControlElementPropertyId :=True
UIA_IsDataValidForFormPropertyId :=False
UIA_IsDockPatternAvailablePropertyId :=False
UIA_IsEnabledPropertyId :=True
UIA_IsExpandCollapsePatternAvailablePropertyId :=False
UIA_IsGridItemPatternAvailablePropertyId :=False
UIA_IsGridPatternAvailablePropertyId :=False
UIA_IsInvokePatternAvailablePropertyId :=False
UIA_IsItemContainerPatternAvailablePropertyId :=False
UIA_IsKeyboardFocusablePropertyId :=True
UIA_IsLegacyIAccessiblePatternAvailablePropertyId :=True
UIA_IsMultipleViewPatternAvailablePropertyId :=False
UIA_IsOffscreenPropertyId :=False
UIA_IsPasswordPropertyId :=False
UIA_IsRangeValuePatternAvailablePropertyId :=False
UIA_IsRequiredForFormPropertyId :=False
UIA_IsScrollItemPatternAvailablePropertyId :=False
UIA_IsScrollPatternAvailablePropertyId :=False
UIA_IsSelectionItemPatternAvailablePropertyId :=False
UIA_IsSelectionPatternAvailablePropertyId :=False
UIA_IsSynchronizedInputPatternAvailablePropertyId :=False
UIA_IsTableItemPatternAvailablePropertyId :=False
UIA_IsTablePatternAvailablePropertyId :=False
UIA_IsTextPatternAvailablePropertyId :=False
UIA_IsTogglePatternAvailablePropertyId :=False
UIA_IsTransformPatternAvailablePropertyId :=False
UIA_IsValuePatternAvailablePropertyId :=True
UIA_IsVirtualizedItemPatternAvailablePropertyId :=False
UIA_IsWindowPatternAvailablePropertyId :=False
UIA_ItemStatusPropertyId :=
UIA_ItemTypePropertyId :=
UIA_LabeledByPropertyId :=
UIA_LegacyIAccessibleChildIdPropertyId :=0
UIA_LegacyIAccessibleDefaultActionPropertyId :=
UIA_LegacyIAccessibleDescriptionPropertyId :=Displays the name of the window and contains controls to manipulate it
UIA_LegacyIAccessibleHelpPropertyId :=
UIA_LegacyIAccessibleKeyboardShortcutPropertyId :=
UIA_LegacyIAccessibleNamePropertyId :=
UIA_LegacyIAccessibleRolePropertyId :=1
UIA_LegacyIAccessibleSelectionPropertyId :=
UIA_LegacyIAccessibleStatePropertyId :=1048576
UIA_LegacyIAccessibleValuePropertyId :=SIEMENS Soarian® Automatic Logoff -- Webpage Dialog
UIA_LocalizedControlTypePropertyId :=title bar
UIA_MultipleViewCurrentViewPropertyId :=0
UIA_MultipleViewSupportedViewsPropertyId :=
UIA_NamePropertyId :=
UIA_NativeWindowHandlePropertyId :=0
UIA_OrientationPropertyId :=0
UIA_ProcessIdPropertyId :=3628
UIA_ProviderDescriptionPropertyId :=[pid:1176,hwnd:0x0 Annotation:Microsoft: Annotation Proxy (unmanaged:uiautomationcore.dll); Main(parent link):Microsoft: MSAA Proxy (unmanaged:uiautomationcore.dll)]
UIA_RangeValueIsReadOnlyPropertyId :=True
UIA_RangeValueLargeChangePropertyId :=0
UIA_RangeValueMaximumPropertyId :=0
UIA_RangeValueMinimumPropertyId :=0
UIA_RangeValueSmallChangePropertyId :=0
UIA_RangeValueValuePropertyId :=0
UIA_RuntimeIdPropertyId :=42;3803234;1;-2147483647;3803234;-2;0
UIA_ScrollHorizontallyScrollablePropertyId :=False
UIA_ScrollHorizontalScrollPercentPropertyId :=0
UIA_ScrollHorizontalViewSizePropertyId :=100
UIA_ScrollVerticallyScrollablePropertyId :=False
UIA_ScrollVerticalScrollPercentPropertyId :=0
UIA_ScrollVerticalViewSizePropertyId :=100
UIA_SelectionCanSelectMultiplePropertyId :=False
UIA_SelectionIsSelectionRequiredPropertyId :=False
UIA_SelectionselectionPropertyId :=
UIA_SelectionItemIsSelectedPropertyId :=False
UIA_SelectionItemSelectionContainerPropertyId :=
UIA_TableColumnHeadersPropertyId :=
UIA_TableItemColumnHeaderItemsPropertyId :=
UIA_TableRowHeadersPropertyId :=
UIA_TableRowOrColumnMajorPropertyId :=2
UIA_TableItemRowHeaderItemsPropertyId :=
UIA_ToggleToggleStatePropertyId :=2
UIA_TransformCanMovePropertyId :=False
UIA_TransformCanResizePropertyId :=False
UIA_TransformCanRotatePropertyId :=False
UIA_ValueIsReadOnlyPropertyId :=False
UIA_ValueValuePropertyId :=SIEMENS Soarian® Automatic Logoff -- Webpage Dialog
UIA_WindowCanMaximizePropertyId :=False
UIA_WindowCanMinimizePropertyId :=False
UIA_WindowIsModalPropertyId :=False
UIA_WindowIsTopmostPropertyId :=False
UIA_WindowWindowInteractionStatePropertyId :=0
UIA_WindowWindowVisualStatePropertyId :=0
Posted

Something like this (do not forget to patch UIAWrappers with the comment I gave earlier)

and if there are multiple buttons ok around it could be you have to add instance property

like

_UIA_Action("name:=OK;controltype:=Button; instance:=2", "click")
#include "UIAWrappers.au3" 

#AutoIt3Wrapper_UseX64=N

_UIA_Action("name:=SIEMENS Soarian.*; class:=Internet Explorer_TridentDlgFrame", "setfocus")
_UIA_Action("name:=OK;controltype:=Button", "click")

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...