Sign in to follow this  
Followers 0
dleonard

WinWait and ControlClick

30 posts in this topic

I am attempting to write my first AutoIt script to detect when a window is present and then click the OK button. Testing has been difficult so I'm looking for some validation of my code from the experts. Am I doing it right?

 

Screenshot of window

Logoff.gif

 

Window Info

>>>> Window <<<<
Title: SIEMENS Soarian® Automatic Logoff -- Webpage Dialog
Class: Internet Explorer_TridentDlgFrame
Position: 665, 450
Size: 356, 152
Style: 0x96C80000
ExStyle: 0x00000101
Handle: 0x00DA0706
 
>>>> Control <<<<
Class: Internet Explorer_Server
Instance: 1
ClassnameNN: Internet Explorer_Server1
Name:
Advanced (Class): [CLASS:Internet Explorer_Server; INSTANCE:1]
ID:
Text:
Position: 0, 0
Size: 350, 120
ControlClick Coords: 281, 62
Style: 0x56000000
ExStyle: 0x00000000
Handle: 0x0080078C
 
>>>> Mouse <<<<
Position: 949, 541
Cursor ID: 0
Color: 0xE8EFFA
 
>>>> StatusBar <<<<
 
>>>> ToolsBar <<<<
 
>>>> Visible Text <<<<
 
 
>>>> Hidden Text <<<<
 
 
Code
#NoTrayIcon
#include <IE.au3>
 
; Wait for logoff window, then click on OK
WinWait("SIEMENS Soarian® Automatic Logoff -- Webpage Dialog")
ControlClick("SIEMENS Soarian® Automatic Logoff -- Webpage Dialog", "", "[CLASS:Button; TEXT:OK; Instance:1;]")

 

Share this post


Link to post
Share on other sites



Hi, dleonard. Are you simply looking for someone to say "yup it looks right",  or are you experiencing an issue closing the window?


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

Hi, dleonard. Are you simply looking for someone to say "yup it looks right",  or are you experiencing an issue closing the window?

I currently don't have access to the application to perform testing so I was looking for someone to validate that my code should execute successfully. Assuming it will work, is it the best method?

Share this post


Link to post
Share on other sites

Given what little info you have on the app, I would say it is definitely the easiest method.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Try this:

Local $sYourTitle = 'SIEMENS Soarian® Automatic Logoff -- Webpage Dialog'
Local $sRegExpTitle = '[REGEXPTITLE:(?i)SIEMENS.*?Webpage.*?Dialog]'
Local $sTitle = WinGetTitle($sRegExpTitle)
ConsoleWrite(StringToBinary($sYourTitle) & @CRLF)
ConsoleWrite(StringToBinary($sTitle) & @CRLF)

and give us console output

EDIT: script correction

Edited by mlipok

Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2017-06-04

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Compile this and run it and you can practice: :) Emulates your message box

_box()
Func _box()
MsgBox(0, "SIEMENS Soarian® Automatic Logoff -- Webpage Dialog", "Click OK to stop LogOff")
        Sleep(10000)
        _box()
EndFunc   ;==>_box

Your Winwait works but only one time, if you need to keep doing said action you will have to loop it.

Bill

Edited by billo

Share this post


Link to post
Share on other sites

@billo

Although it is worth a try, it may not be that simple.
 
I suspect that the name used are white characters are not spaces.
From there the problem.

 

For example look here:

And that's why I suggested the test using the function: StringToBinary()


Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2017-06-04

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Although you'll never meet the max recursion, your general idea is flawed, billo.

You should have a loop calling the function, and not have the function calling itself.

While True
    If _box() > 1 Then Exit  
WEnd
Func _box()
     Sleep(5000)
    Return MsgBox(1,"SIEMENS Soarian® Automatic Logoff -- Webpage Dialog", "Click OK to stop LogOff")
EndFunc
Edited by jdelaney

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites

if it's just a little stay awake program, maybe adlib?

#include <IE.au3>

AdlibRegister("dodgeLogoff",3500)

Func dodgeLogoff()
    local $sTitle = "Local $sYourTitle = 'SIEMENS Soarian® Automatic Logoff -- Webpage Dialog'"
    Local $oIE = _IEAttach($sTitle)
    if @error = 0 then
            ;determine button and use _IEFormSubmit or something to submit
    EndIf
EndFunc

Share this post


Link to post
Share on other sites

Try this:

Local $sYourTitle = 'SIEMENS Soarian® Automatic Logoff -- Webpage Dialog'
Local $sRegExpTitle = '[REGEXPTITLE:(?i)SIEMENS.*?Webpage.*?Dialog]'
Local $sTitle = WinGetTitle($sRegExpTitle)
ConsoleWrite(StringToBinary($sYourTitle) & @CRLF)
ConsoleWrite(StringToBinary($sTitle) & @CRLF)

and give us console output

EDIT: script correction

I hope this is what you mean by console output? This was generated WITHOUT the log off window open.

0x5349454D454E5320536F617269616EAE204175746F6D61746963204C6F676F6666202D2D2057656270616765204469616C6F67
0x30

Share this post


Link to post
Share on other sites

 

I hope this is what you mean by console output? This was generated WITHOUT the log off window open.

0x5349454D454E5320536F617269616EAE204175746F6D61746963204C6F676F6666202D2D2057656270616765204469616C6F67
0x30

 

 

Unfortunately, I was interested in the results With opened window.


Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2017-06-04

Share this post


Link to post
Share on other sites

Unfortunately, I was interested in the results With opened window.

 

Here are the results of your code from the console, with the window open.

Note - I mistakenly ran it twice.

0x5349454D454E5320536F617269616EAE204175746F6D61746963204C6F676F6666202D2D2057656270616765204469616C6F67
0x5349454D454E5320536F617269616EAE204175746F6D61746963204C6F676F6666202D2D2057656270616765204469616C6F67
 
What does this mean?

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

0x5349454D454E5320536F617269616EAE204175746F6D61746963204C6F676F6666202D2D2057656270616765204469616C6F67

0x5349454D454E5320536F617269616EAE204175746F6D61746963204C6F676F6666202D2D2057656270616765204469616C6F67
 
What does this mean?

 

They are the same.


try this

WinWait("SIEMENS Soarian® Automatic Logoff -- Webpage Dialog")
TrayTip('Test','Logoff Window appeared',100)
ControlClick("SIEMENS Soarian® Automatic Logoff -- Webpage Dialog", "", "[CLASS:Button; TEXT:OK; Instance:1;]")

I think Logoff window appears, WinWait catch that fact, but ControlClick() can't  click because it is not a normal Button.

Is it     IE GUI ?  Am I right?

If so, try something like this:

 

#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, 'hwnd')
    ConsoleWrite(@CRLF)
    ConsoleWrite('===============================================')
    ConsoleWrite(@CRLF)
    $sHTML = _IEPropertyGet($oIELogOff, "outerhtml")
    ClipPut($sHTML)
    ConsoleWrite($sHTML)
    ConsoleWrite(@CRLF)
    ConsoleWrite('===============================================')
    ConsoleWrite(@CRLF)
EndIf
Based on this you can use something like this:
_IEAction ($oButtonOK, "click")
 
Edit: small script correction
Edited by mlipok

Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2017-06-04

Share this post


Link to post
Share on other sites

#15 ·  Posted (edited)

yes, it is IE GUI (a webpage dialog) so _IEAction shud work if his script isn't paused with no problems, ControlClick can work 2 but only on ControlClick Coords instead

Edited by bogQ

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)



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.

 

Share this post


Link to post
Share on other sites

ControlClick can work 2 but only on ControlClick Coords instead

 

In fact, I thought about it too, but I noticed that the OP uses
#include <IE.au3>
So it seemed to me to be a natural choice to use _IEAction

Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2017-06-04

Share this post


Link to post
Share on other sites
#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, 'hwnd')
    ConsoleWrite(@CRLF)
    ConsoleWrite('===============================================')
    ConsoleWrite(@CRLF)
    $sHTML = _IEPropertyGet($oIELogOff, "outerhtml")
    ClipPut($sHTML)
    ConsoleWrite($sHTML)
    ConsoleWrite(@CRLF)
    ConsoleWrite('===============================================')
    ConsoleWrite(@CRLF)
EndIf
Console output for the code above is...
 
--> IE.au3 V2.4-0 Warning from function _IEAttach, $_IEStatus_NoMatch
 
===============================================
--> IE.au3 V2.4-0 Error from function _IEPropertyGet, $_IEStatus_InvalidDataType
0
===============================================
 
 
Also, the following code did not click on the OK button to interrupt the log off...
#include <IE.au3>

AdlibRegister("dodgeLogoff",3500)

WinWait("SIEMENS Soarian® Automatic Logoff -- Webpage Dialog")
dodgeLogoff()

Func dodgeLogoff()
    local $sTitle = "Local $sYourTitle = 'SIEMENS Soarian® Automatic Logoff -- Webpage Dialog'"
    Local $oIE = _IEAttach($sTitle)
    If @error = 0 then
    _IEAction ($oButtonOK, "click")
    EndIf
EndFunc

Share this post


Link to post
Share on other sites

First problem is here:

 


Console output for the code above is...
 
--> IE.au3 V2.4-0 Warning from function _IEAttach, $_IEStatus_NoMatch
 
===============================================
--> IE.au3 V2.4-0 Error from function _IEPropertyGet, $_IEStatus_InvalidDataType
0
===============================================
 

 

 

Second problem you can't just use _IEAction like that:

 

 

 

#include <IE.au3>

AdlibRegister("dodgeLogoff",3500)

WinWait("SIEMENS Soarian® Automatic Logoff -- Webpage Dialog")
dodgeLogoff()

Func dodgeLogoff()
local $sTitle = "Local $sYourTitle = 'SIEMENS Soarian® Automatic Logoff -- Webpage Dialog'"
Local $oIE = _IEAttach($sTitle)
If @error = 0 then
    _IEAction ($oButtonOK, "click")
EndIf
EndFunc

 

You must get a reference to this IE Object - I mean to this button.

But for this you must resolve first problem.

Like I say "thinking does not hurt, but it takes time"

So you must wait, for my or others additional hints ;)


Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2017-06-04

Share this post


Link to post
Share on other sites

Change:

$oIELogOff = _IEAttach($hLogOff, 'hwnd')

to this:

$oIELogOff = _IEAttach($hLogOff, 'DialogBox')

 
 
Be careful
before pasting, see the "outerHTML" does not contain sensitive data.

Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2017-06-04

Share this post


Link to post
Share on other sites

you're not getting a title match, I'd settle for a partial match and leave out the 'circled R' symbol.

local $sTitle = "Automatic Logoff -- Webpage Dialog"
    Local $oIE = _IEAttach($sTitle,"WindowTitle")

Post the html behind that page and someone will help you.

Share this post


Link to post
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
Sign in to follow this  
Followers 0