SmOke_N

IEEx - IE extended library with some Javascript options

14 posts in this topic

#1 ·  Posted (edited)

This is just a revision of >IEJS.au3 Library, with more functions and a better naming attribute to what the library actually is.

You'll find standard AutoIt object functions as well as internally executed Javascript ones (functions with: _IEEx_JS* are javascript functions).

To read more on how this came about or previous versions, please see the IEJS.au3 page.

When reporting issues, please provide:

Issue you've encountered.

Replication code (If I can't run your code, I won't debug it more than likely).

AutoIt version

IE version

IE update version

SciTe Version if you ran it from SciTe

Functions:

;    _IEEx_CallObjEval()
;    _IEEx_CallObjExecScript() - Fixed
;    _IEEx_CheckAppVersionAlways()
;    _IEEx_ClassNameGetArray() - New
;    _IEEx_ClickObjByPoint()
;    _IEEx_CreateWithParams() - Fixed
;    _IEEx_EmbeddedGetVersion()
;    _IEEx_EmbeddedSetVersion()
;    _IEEx_GetAppMajorVersion()
;    _IEEx_GetObjByClassName() - New
;    _IEEx_GetObjByString() - New
;    _IEEx_GetObjEval()
;    _IEEx_GetObjParentWindow()
;    _IEEx_GetObjPos()
;    _IEEx_GetObjType()
;    _IEEx_GetScroll()
;    _IEEx_GetScrollPoint()
;    _IEEx_GetWindowSize()
;    _IEEx_ObjCheckBoxRadioSelect() - New
;    _IEEx_ObjDispatchEvent() - New
;    _IEEx_MouseEventExec()
;    _IEEx_JSClassNameGetArray()
;    _IEEx_JSClassNameGetCollection()
;    _IEEx_JSClickObj()
;    _IEEx_JSClickObjById()
;    _IEEx_JSClickObjByName()
;    _IEEx_JSClickObjByPoint()
;    _IEEx_JSDragEventObj()
;    _IEEx_JSEnable()
;    _IEEx_JSGetObjByClassName()
;    _IEEx_JSGetObjPos()
;    _IEEx_JSIsEnabled()
;    _IEEx_JSMouseEventObj()
;    _IEEx_JSMouseEventObjById()
;    _IEEx_JSMouseEventObjByName()
;    _IEEx_JSObjQuerySelector()
;    _IEEx_JSObjQuerySelectorAll()
;    _IEEx_JSTypeOf()
;    _IEEx_TabAttach()
;    _IEEx_TabCount()
;    _IEEx_TabCreate()
;    _IEEx_TabGetInstance()
;    _IEEx_VersionInfo()
;    _IEEx_WhileIsObj() - New
;    _IEEx_WhileNotIsObj() - New
;    _IEEx_WinGetBrowserObjArray()

Changes:

2014-12-30    B0.0.6    Added:    _IEEx_EmbeddedGetVersion()Get the embedded version used from something like
                                                          _IECreateEmbedded
2014-12-30    B0.0.6    Added:    _IEEx_EmbeddedSetVersion()Set the embedded version used from something like
                                                          _IECreateEmbedded (see example)
2014-12-30    B0.0.6    Added:    _IEEx_TabAttach()Similar to _IEAttach(), but browser specific and different string cases
2014-12-30    B0.0.6    Added:    _IEEx_TabCount()Get a count of the tabs open in a specific browser session
2014-12-30    B0.0.6    Added:    _IEEx_TabGetInstance()Get the tab instance number from the specific browser session
2014-12-30    B0.0.6    Added:    _IEEx_WinGetBrowserObjArray()Get all the browser objects (tabs) from a specific browser
                                                             window handle/title
2015-01-13    B0.0.7    Changed:  _IEJS format to _IEEx - Script breaking
2015-01-20    B0.0.7    Fixed     _IEEx_CreateWithParams()Issue with tryattach, wait, and focus.
                                                          Added return object/pid feature
2015-01-22    B0.0.7    Fixed:    _IEEx_CallObjExecScript()Recursion issue when IE version is 11 or higher and no exeScript
2015-01-26    B0.0.7    Added:    _IEEx_ClassNameGetArray()Retrieve an array of objects based on class
2015-01-26    B0.0.7    Added:    _IEEx_GetObjByClassName()Retrieve an object based on class
2015-01-26    B0.0.7    Added:    _IEEx_GetObjByString()Retrieve an object by its innerText or value
2015-01-26    B0.0.7    Added:    _IEEx_ObjCheckBoxRadioSelect()(Un)Check/(De)Select radio or checkbox, has dispatchevent
                                                                option as well as fireevent
2015-01-26    B0.0.7    Added:    _IEEx_ObjDispatchEvent()similar to fireEvent
2015-01-26    B0.0.7    Added:    _IEEx_WhileIsObj()waits until an object is no longer an object (could come in handy for
                                                    waiting on page loads rather than hoping you have the right about of
                                                    Sleep(n) allocated)
2015-01-26    B0.0.7    Added:    _IEEx_WhileNotIsObj()waits until a variable is an object (could come in handy for
                                                    waiting on page loads rather than hoping you have the right about of
                                                    Sleep(n) allocated)
2015-01-26    B0.0.8    Fixed:    _IEEx_GetAppMajorVersion()Was being passed regular objects but only checking for browser
                                                            Thank you mLipok for reporting and testing for me

 

2015-01-26IEEx.B007.zip

2015-01-26IEEx.B008.zip

.

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Trying to use and:
 

>"C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /beta /ErrorStdOut /in "Z:TOOLsMacroFORUM___FORUM -- z forumIEEx.B007ExamplesIEExMouseClickExample.au3" /UserParams  
+>17:23:16 Starting AutoIt3Wrapper v.14.801.2025.5 SciTE v.3.5.2.0   Keyboard:00000415  OS:WIN_7/Service Pack 1  CPU:X64 OS:X64    Environment(Language:0415)
+>         SciTEDir => C:Program Files (x86)AutoIt3SciTE   UserDir => C:UsersuserAppDataLocalAutoIt v3SciTEAutoIt3Wrapper   SCITE_USERHOME => C:UsersuserAppDataLocalAutoIt v3SciTE
>Running AU3Check (3.3.13.19)  from:C:Program Files (x86)AutoIt3Beta  input:Z:TOOLsMacroFORUM___FORUM -- z forumIEEx.B007ExamplesIEExMouseClickExample.au3
+>17:23:16 AU3Check ended.rc:0
>Running:(3.3.13.19):C:\Program Files (x86)\AutoIt3\Beta\autoit3.exe "Z:TOOLsMacroFORUM___FORUM -- z forumIEEx.B007ExamplesIEExMouseClickExample.au3"  
--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
"Z:TOOLsMacroFORUM___FORUM -- z forumIEEx.B007ExamplesIEEx.au3" (188) : ==> The requested action with this object has failed.:
Return $oExec.execScript($sScript)
Return $oExec^ ERROR

->17:23:21 AutoIt3.exe ended.rc:1
+>17:23:21 AutoIt3Wrapper Finished.
>Exit code: 1    Time: 5.593

EDIT:

IE 11.0.9600.17501
IEup. 11.0.15 KB3008923
Win 7 Pro 64Bit
SciTE latest Beta

_IEEx_VersionInfo:
Version: B0.0.7
Release Date: 2015-01-13

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

and second issue:

 

>"C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /beta /ErrorStdOut /in "Z:TOOLsMacroFORUM___FORUM -- z forumIEEx.B007ExamplesIEExMouseEventGetPosGetScrollExample.au3" /UserParams   
+>17:32:56 Starting AutoIt3Wrapper v.14.801.2025.5 SciTE v.3.5.2.0   Keyboard:00000415  OS:WIN_7/Service Pack 1  CPU:X64 OS:X64    Environment(Language:0415)
+>         SciTEDir => C:Program Files (x86)AutoIt3SciTE   UserDir => C:UsersuserAppDataLocalAutoIt v3SciTEAutoIt3Wrapper   SCITE_USERHOME => C:UsersuserAppDataLocalAutoIt v3SciTE
>Running AU3Check (3.3.13.19)  from:C:Program Files (x86)AutoIt3Beta  input:Z:TOOLsMacroFORUM___FORUM -- z forumIEEx.B007ExamplesIEExMouseEventGetPosGetScrollExample.au3
+>17:32:56 AU3Check ended.rc:0
>Running:(3.3.13.19):C:\Program Files (x86)\AutoIt3\Beta\autoit3.exe "Z:TOOLsMacroFORUM___FORUM -- z forumIEEx.B007ExamplesIEExMouseEventGetPosGetScrollExample.au3"   
--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
!>17:33:23 AutoIt3.exe ended.rc:-1073741571
+>17:33:23 AutoIt3Wrapper Finished.
>Exit code: 3221225725    Time: 26.82

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

LOL, that was fast!!!

Not having IE11 sucks... I'll see what I can do, thanks.


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

Issue fixed I believe, thanks mLipok for helping!


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

>"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:Documents and SettingsDanPollakDesktopIEEx.B008ExamplesIEExClassNameArrayExample.au3" /UserParams    

+>11:39:08 Starting AutoIt3Wrapper v.2.2.0.3 SciTE v.3.4.1.0   Keyboard:00000409  OS:WIN_XP/Service Pack 3  CPU:X64 OS:X86    Environment(Language:0409)

+>         SciTEDir => C:Program FilesAutoIt3SciTE   UserDir => C:Documents and SettingsDanPollakLocal SettingsApplication DataAutoIt v3SciTEAutoIt3Wrapper   SCITE_USERHOME => C:Documents and SettingsDanPollakLocal SettingsApplication DataAutoIt v3SciTE

>Running AU3Check (3.3.12.0)  from:C:Program FilesAutoIt3  input:C:Documents and SettingsDanPollakDesktopIEEx.B008ExamplesIEExClassNameArrayExample.au3

+>11:39:08 AU3Check ended.rc:0

>Running:(3.3.12.0):C:Program FilesAutoIt3autoit3.exe "C:Documents and SettingsDanPollakDesktopIEEx.B008ExamplesIEExClassNameArrayExample.au3"    

--> Press Ctrl+Alt+F5 to Restart or Ctrl+Break to Stop

"C:Documents and SettingsDanPollakDesktopIEEx.B008ExamplesIEEx.au3" (1650) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.:

$aORet[$iCount] = $oItem

^ ERROR

->11:39:14 AutoIt3.exe ended.rc:1

+>11:39:14 AutoIt3Wrapper Finished.

>Exit code: 1    Time: 6.191

 

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

IE11 Dan?

Edit:
I believe I've fixed that issue, but I think I'll wait until anymore are found.  The fix if you want to insert yourself until then:

Func _IEEx_JSClassNameGetArray(ByRef $oObj, $sClass, $sTag = Default)

    Local $oItems = _IEEx_JSClassNameGetCollection($oObj, $sClass)
    If @error Then
        Return SetError(@error, @extended, 0)
    EndIf

    $sTag = ((StringLen($sTag) And Not IsKeyword($sTag)) ? StringLower($sTag) : "")

    Local $iLen = Int($oItems.length)
    If @error Or $iLen = 0 Then
        Return SetError($_IESTATUS_InvalidValue, -1, 0)
    EndIf
    
    Local $aORet[$iLen]
    Local $iCount = 0
    For $oItem In $oItems
        If StringLen($sTag) Then
            If $sTag <> StringLower($oItem.tagName) Then ContinueLoop
        EndIf
        If $iCount = $iLen Then ExitLoop
        $aORet[$iCount] = $oItem
        $iCount += 1
    Next

    ReDim $aORet[$iCount]
    Return SetError($_IESTATUS_Success, 1, $aORet)
EndFunc   ;==>_IEEx_JSClassNameGetArray

.

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

No, actually IE8. This is on an old XP box. :o:)

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Little confused by _IEEx_WhileNotIsObj.

How would one pass an object if that object does not exist in the functions current form (IEEx.B008)? 

EDIT:

Because the first thing the function does is...

If Not IsObj($oObj) Then
    Return SetError($_IESTATUS_InvalidDataType, 1, 0)
EndIf
Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

I believe _IEEx_JSClassNameGetArray is still broken. When I run the example, $iLen = 6, yet $oItems appears to contain 49 items.

Edit: This is somewhat confirmed by IEExClassNameCollectionExample.au3, which outputs 49 "Tag" lines with the last 43 being blank.

Edited by Danp2

Share this post


Link to post
Share on other sites

fun fun fun... (actually it is, No feedback on the other so I didn't know these were would be broke :) ).

@John, cute huh?  I must admit, that's a standard first line for me in EVERY object udf lol.  I probably did it without thinking... Thanks

@Danp2... it's a javascript issue, I will look over it and try to find an alternative... thanks


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

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

I am curious, why you use 

Local $oDPWE = Execute('$oObj.document.getElementById("IEExAutEvalObjId")')

instead:

Local $oDPWE = $oObj.document.getElementById("IEExAutEvalObjId")

?


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

I hope someone can help me. (if this isn't outdated)

>"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "C:\Users\Hans\Desktop\YouTube Upvote Downloader\YouTube upvotes loader with IEEX.au3" /UserParams    
+>19:05:52 Starting AutoIt3Wrapper v.16.306.1237.0 SciTE v.3.6.2.0   Keyboard:00000807  OS:WIN_10/  CPU:X64 OS:X64  Environment(Language:0407)  CodePage:0  utf8.auto.check:4    # detect ascii high characters and if none found set default encoding to UTF8 and do not add BOM
+>         SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE   UserDir => C:\Users\Hans\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper   SCITE_USERHOME => C:\Users\Hans\AppData\Local\AutoIt v3\SciTE 
>Running AU3Check (3.3.14.2)  from:C:\Program Files (x86)\AutoIt3  input:C:\Users\Hans\Desktop\YouTube Upvote Downloader\YouTube upvotes loader with IEEX.au3
+>19:05:52 AU3Check ended.rc:0
>Running:(3.3.14.2):C:\Program Files (x86)\AutoIt3\autoit3_x64.exe "C:\Users\Hans\Desktop\YouTube Upvote Downloader\YouTube upvotes loader with IEEX.au3"    
--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
"C:\Program Files (x86)\AutoIt3\Include\IEEX.au3" (280) : ==> The requested action with this object has failed.:
If String($oTag.classname) = $sClass Then
If String($oTag^ ERROR
->19:07:49 AutoIt3.exe ended.rc:1
+>19:07:49 AutoIt3Wrapper Finished.
>Exit code: 1    Time: 117.6

It happens, when i'm trying to _IEEx_GetObjByClassName frequently in succession.

 

I hope u can help and have a nice day.

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

  • Similar Content

    • Chimp
      By Chimp
      An example on how to inject jQuery into a web page
      It can be useful to manage the page from AutoIt using jQuery.
      Idea from here: http://www.learningjquery.com/2009/04/better-stronger-safer-jquerify-bookmarklet
      Suggestions and improvements are welcome
      #include <ie.au3> Example() Func Example() Local $oIE = _IECreate("www.google.com") Local $jQuery = _jQuerify($oIE) MsgBox(0, "Version", "jQuery version: " & $jQuery.fn.jquery) MsgBox(0, "Example", "click ok to exit." & @CRLF & "Google logo will fade out by jQuery...") $jQuery('#hplogo').fadeOut(3000) ; jQuery will fade out the google logo EndFunc ;==>Example ; #FUNCTION# ==================================================================================================================== ; Name ..........: _jQuerify ; Description ...: ; Syntax ........: _jQuerify(Byref $oIE) ; Parameters ....: $oIE - Object variable of an InternetExplorer.Application. ; Return values .: an object variable pointing to the jQuery library ; Author ........: Chimp ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: ; =============================================================================================================================== Func _jQuerify(ByRef $oIE) Local $jsEval, $jQuery, $otherlib = False ; create a reference to the javascript eval() function $oIE.document.parentWindow.setTimeout('document.head.eval = eval', 0) Do Sleep(250) $jsEval = Execute('$oIE.Document.head.eval') Until IsObj($jsEval) ; if jQuery is not already loaded then load it If $jsEval("typeof jQuery=='undefined'") Then ; check if the '$' (dollar) name is already in use by other library If $jsEval("typeof $=='function'") Then $otherlib = True Local $oScript = $oIE.document.createElement('script'); $oScript.type = 'text/javascript' ; If you want to load jQuery from a disk file use the following statement ; where i.e. jquery-1.9.1.js is the file containing the jQuery source ; (or also use a string variable containing the whole jQuery listing) ;~ $oScript.TextContent = FileRead(@ScriptDir & "\jquery-1.9.1.js") ; <--- from a file ; If you want to download jQuery from the web use this statement $oScript.src = 'https://code.jquery.com/jquery-latest.min.js' ; <--- from an url $oIE.document.getElementsByTagName('head').item(0).appendChild($oScript) Do Sleep(250) Until $jsEval("typeof jQuery == 'function'") EndIf Do Sleep(250) $jQuery = $jsEval("jQuery") Until IsObj($jQuery) If $otherlib Then $jsEval('jQuery.noConflict();') Return $jQuery EndFunc ;==>_jQuerify  
    • Pere
      By Pere
      Hi all,
      I've written the script below to automatically login to a website, in this case infusionsoft.com
      The auto login works fine. Is there a way for me to get errors from Internet explorer, if the login fails because of wrong login credentials. I have searched around, but cannot make sense of this.
      Please forgive me if I have overlooked something simple. I am new to autoit. Please see my script below.
      #include <IE.au3>
      #include <MsgBoxConstants.au3>

      Func AccountAutoLogin()
         ;This line sets the website page to open and inject information
         Global $oIE = _IECreate("https://signin.infusionsoft.com/login")
         ;set the variables to pull the username and password object names
         Local $username = _IEGetObjByName ($oIE, "username")
         Local $password = _IEGetObjByName ($oIE, "password")
         ;set the $oButtons variable to pull all the values of the button class
         Local $oButtons = _IETagnameGetCollection($oIE, "button")
         ;set the username and password values on the login form
         _IEFormElementSetValue ($username, "")
         _IEFormElementSetValue ($password, "")
         ; loop through the button class until we find the text on the login button, then click the button
         For $oButton in $oButtons
            If String($oButton.value) = " Log In " Then $test = $oButtons
               _IEAction($oButton, "click")
               _IELoadWait($oIE)
               if (@error) then MsgBox (0, "Error", @error)
            ExitLoop
         Next
      EndFunc
    • XaelloNegative
      By XaelloNegative
      Hi there.
      Im having some kind of a coder block here, 
      <td class="treeview ctl00_CenterContent_objTreeView_2" style="white-space:nowrap;"> <input type="checkbox" name="ctl00_CenterContent_objTreeViewn1CheckBox" id="ctl00_CenterContent_objTreeViewn1CheckBox"> <span class="ctl00_CenterContent_objTreeView_0 treeview ctl00_CenterContent_objTreeView_1" id="ctl00_CenterContent_objTreeViewt1" style="border-style:none;font-size:1em;"> <i class="fa fa-file-code-o fa-fw"> </i> <span data-placement="bottom" data-toggle="tooltip" title="" data-original-title="Tool tip for said part">REFUNDS</span></span></td> this is a code directly from the website im working with. I was thinking of inserting a javascript that would get the "REFUNDS" part. Any ideas on how to do so?
      Any thoughts will be highly appreciated.
    • Patryk
      By Patryk
      Dear Colleagues,
      I have no idea how to refer to style.display in my loop. There is a button like: 
      <input name="ctl00$bodyPlaceholder$btnFecharProcessamento" class="button" id="bodyPlaceholder_btnFecharProcessamento" style="display: none;" onclick="FecharJanelaProcessamento();return false;" type="submit" value="Fechar"> I want it to be clicked as soon as button's style change from style="display: none;" to  style= ="display: inline-block;" 
      This is what I got, but it's not working...
      Func GetButtons() $oButtons = _IEGetObjByName($oForm,"ctl00$bodyPlaceholder$btnFecharProcessamento",-1) $i = 0 While $i <> 1 For $oBtn In $oButtons If _IEFormElementGetValue($oBtn) = "Fechar" And $oBtn.document.style.display = "display: inline-block;" Then $i = 1 _IEAction($oBtn, "focus") _IEAction($oBtn, "click") ExitLoop EndIf Next WEnd EndFunc  
      I will really appreciate if you could help me with these loop!
    • Omnitica
      By Omnitica
      Hello!
      I'm new to the forums! Couldn't find any threads covering this issue. Sorry if I'm wrong.

      I'm having problems changing the text/value of a input box. The particular box doesn't have a name or id, just: class="jq_hotkeys_enabled form-control".
      This class appears multiple times throughout the source, so I don't think It's right to reference that object. 
      See image 1.
      However, I've managed to find a object with the name "ctl00$content$ctrl$ucServiceTime$rpServicetimes$ctl00$edtHiddenResourceHelper" which contains the value of the input box, and the id for the person in the dropdown/combobox left of it. (with "dummy-1" selected).
      See image 2.
      As you can see the value is 3982,4545     ( name , time )
      But when I try to change the value of it by doing:
      #include <IE.au3> Local $oIE = _IEAttach(WinGetHandle("[CLASS:IEFrame]"),"embedded") Local $oForm = _IEFormGetObjByName($oIE, "aspnetForm") Local $oInput = _IEFormElementGetObjByName($oForm, "ctl00$content$ctrl$ucServiceTime$rpServicetimes$ctl00$edtHiddenResourceHelper") _IEFormElementSetValue($oInput, "3982,1337") The box doesn't get its new value. I  can see in the source that it's changed though.
      See image 3.
       
      However, if I do: 
      #include <IE.au3> Local $oIE = _IEAttach(WinGetHandle("[CLASS:IEFrame]"),"embedded") Local $oForm = _IEFormGetObjByName($oIE, "aspnetForm") Local $oInput = _IEFormElementGetObjByName($oForm, "ctl00$content$ctrl$ucServiceTime$rpServicetimes$ctl00$edtHiddenResourceHelper") _IEFormElementSetValue($oInput, "3982,1337") $oIE.document.parentwindow.execScript("theForm.submit()") ; But it needs to reload the page The box gets its new value after the page reloads by the theForm.submit() function. 
      This is a bit unfortunate as I want the changes to happen instantly like when I type in the box with the keyboard... or select in the combobox.
      Maybe someone knows how I can do this? Looking forward to an answer! 
      Thanks in advance.
       
      Note: Unfortunately I can't provide with the real URL as it is constricted to employees in the company I work for, but let me know If I should provide anything else.