2 posts in this topic
As the title says. I open IE11 and navigate to a page with the following HTML5 file upload container in Capture0.JPG
I want to click Add Files but I haven't been able to. Here's the code that handles the Add Files button in Capture.JPG
_IEGetObjectById and then using _IEAction to click it doesn't work. I can't give access to the actual page unfortunately because it's password protected.
All suggestions welcome.
By Kevin Finnegan
Long time lurker and now forum poster! I'm writing a relatively simple backup script for my firm that automates the copy, compression and organization of Leaver's data on one of our secured NAS systems. I personally found the best method to do this so far was to use 7zG.exe (GUI version of 7Zip which can use command-line too) and it functions quite well!
I would like to retrieve more info on whether any warnings or errors happen in 7Zip during the backup, but I can't quite get my head around the syntax and switches for reading out, it seems any adjustment I make to the RunWait call's string seems to break the backup or give unexpected repercussions! Hopefully its something silly I'm doing as I don't code very often.
Here is the working version:
; Compress the directories one by one in the zip using the listfile.... Local $iPID = RunWait(@ScriptDir & "\bin\7zG.exe a -mx" & $compressionQuality & " -v" & $compressSplitFileSize & " -wc:\temp " _ & $backupToLocation & "\" & $userDirectory & ".7z @bin\listfile.txt -x@bin\excludefile.txt", "", @SW_SHOWDEFAULT, $STDOUT_CHILD) Ultimately I would love to switch entirely to 7za.exe (standalone) so that I can read the progress percentage, current file being uploaded and any warnings or errors could be processed and output to the AutoIT script's GUI I've created rather than jumping in and out of two applications per se.
Perform a simple google search!
The script below works fine until fill the google form!
What I can't find is how to submit the form, tried a couple of ways and none of them worked.
#include <IE.au3> $oIE = _IECreate ("www.google.com") $o_form = _IEFormGetObjByName ($oIE, "f") $o_login = _IEFormElementGetObjByName ($o_form, "q") $username = "80251369" _IEFormElementSetValue ($o_login, $username) $o_numer = _IEGetObjByName($o_form, "btnK") _IEAction ($o_numer, "click")
The code runs without any problem.
I don't know how to proceed!
Thanks in advance!
I have one script that creates _IECreateEmbedded and another script that does _IEAttach.
I do this because when autoit is doing something, the Embedded IE starts stalling (eg jquery progress animation)
But there is a new problem.
When IE is having its own process (like in the example above) any _IE command is slow (in the script that Attaches).
Here is a comparison of when its in separate and when its in same process:
Separate process _IETagNameGetCollection : 5000ms
Separate process _IEAction: 850ms
Same process _IETagNameGetCollection : 1ms
Same proccess _IEAction: 135ms
If I try to attach to an embedded IE that is done in c#, I get lightning fast results.
As you can see, _IE functions work very slow when the embedded IE we are attaching to is made in Autoit.
I did a test and if I empty the WHILE loop in IE process I get these results(but the cpu is at 30% as expected):
Separate process _IETagNameGetCollection : 33ms
Separate process _IEAction: 13ms
It slows down if you put anything (like GUIGetMsg) in the WHILE loop.
How do I fix this?
#include <GUIConstantsEx.au3> #include <IE.au3> #include <WindowsConstants.au3> Local $oIE = _IECreateEmbedded() GUICreate("My Embedded Web control Test", 640, 580, (@DesktopWidth - 640) / 2, (@DesktopHeight - 580) / 2, $WS_OVERLAPPEDWINDOW + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN) GUICtrlCreateObj($oIE, 10, 40, 600, 360) GUISetState(@SW_SHOW) ;Show GUI _IENavigate($oIE, "http://www.autoitscript.com") $timer = TimerInit() $oLink = _IETagNameGetCollection($oIE, "a", 3) ;takes 1ms ConsoleWrite(TimerDiff($timer) & @CRLF) $timer = TimerInit() _IEAction($oLink, "click") ;takes 135ms ConsoleWrite(TimerDiff($timer) & @CRLF) While 1 Local $iMsg = GUIGetMsg() Select Case $iMsg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd
Attach to IE:
#include <IE.au3> Local $oIE = _IEAttach("My Embedded Web control Test", "embedded") $timer = TimerInit() $oLink = _IETagNameGetCollection($oIE, "a", 3) ; 5000ms ConsoleWrite(TimerDiff($timer) & @CRLF) $timer = TimerInit() _IEAction($oLink, "click") ; 850ms ConsoleWrite(TimerDiff($timer) & @CRLF)
How to set the input border color?
tks in advance