Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/15/2016 in all areas

  1. Automate all windows and browser applications with one UDF function library. Based on the microsoft automation API this library high level supports Recognition of conttrols from EDGE, Chrome, FF, Opera, Safari and Windows native apps Small testing framework to split object repository from coding away Introduction Quickstart - Getting started quickly Simple scripts With this module you can automate all applications/programs that support ui automation and/or accesibility api from microsoft you can recognize more controls than AutoIT can recognize "out of the box" you can use concepts from other testing frameworks like http://download.freedesktop.org/ldtp/doc/ldtp-tutorial.pdf http://safsdev.sourceforge.net/Default.htm coded ui testing from microsoft Some of those controls / applications are chrome browser (partly mainwindow has to be done with MSAA for navigating) chrome://accessibility in the adress bar of chrome or start with "--force-renderer-accessibility" silverlight controls Ribbon control controlbars of Excel/Word IE and FF browsers Windows Media Player Windows clock AFX .. controls (partly) .... Based on the initial AIO Object I now have made the interface file to work with objCreateInterface function which is in the latest beta's automate clicking and querying basic information It gives you a lot of basic information to be able to automate clicking, querying basic information where it goes further in certain situations than AutoIt is identifying Starting threads for background on the ui automation api of microsoft (not for starters) http://en.wikipedia.org/wiki/Microsoft_UI_Automation http://msdn.microsoft.com/en-us/library/ms747327.aspx Previous threads in general help/support Interface AutoItObject IUIAutomation ObjCreateInterface and struct tagPoint in method ElementFromPoint Be aware that API is not allways installed under XP/Vista see http://support.microsoft.com/kb/971513 Within Windows 7 and Windows 8 it should be preinstalled by default. Be aware on 32 and 64 bits way of running your script #AutoIt3Wrapper_UseX64=Y or N Basic example of usage / showing and retrieving the default information, will post multiple examples later Hover your mouse to an area of interest and press ctrl+w and information will be shown in the edit box of the form Simple spy demo (see simplespy.au3 or use latest ZIP attachment for latest version) Main features Recognize windows and html controls for the major browsers Logical and physical description for controls (UI mapping, Application map) Simple repository logic to abstract logical and physical descriptions Store Runtime Type Information in RTI. variables Rubberbanding/highlighting of objects Simple spy to help in making / identifying the physical description Support of regular expression(s) in identifying objects recognize objects on multiple properties supported properties: name ,title, automationid, classname, class, iaccessiblevalue, iaccessiblechildId, controltype, processid, acceleratorkey The actions provided so far "leftclick", "left", "click", "leftdoubleclick", "leftdouble", "doubleclick", _ "rightclick", "right", "rightdoubleclick", "rightdouble", _ "middleclick", "middle", "middledoubleclick", "middledouble", "mousemove", "movemouse" "setvalue","settextvalue" "setvalue using keys" "setValue using clipboard" "getvalue" "sendkeys", "enterstring", "type", "typetext" "invoke" "focus", "setfocus", "activate" "close" "move","setposition" "resize" "minimize", "maximize", "normal", "close", "exist", "exists" "searchcontext", "context" "highlight" "getobject","object" "attach" "capture","screenshot", "takescreenshot" "dump", "dumpthemall" "propertyvalue", "property" match on multiple properties like: name:=((Zoeken.*)|(Find.*)); ControlType:=Button; acceleratorkey:=Ctrl+F Support for 117 different properties see $UIA_propertiesSupportedArray in uiawrappers like for example title, regexptitle, class, regexpclass, iaccessiblevalue, iaccessiblechildid, name, accesskey, automationid, classname IAccessible, IAccessible2, ISimpleDom interfaces debuglogging to a file log.txt (no output in scitewindow) Examples Example 1 Iterating thru the different ways of representing the objects in the tree (#comment-1105548) Example 2 Finding the taskbar and clicking on the start menu button (#comment-1105680) Example 3 Clicking a litlle more and in the end displaying all items from the clock (thats not directly possible with AU3Info) (#comment-1108849) Example 4 that demonstrates the calculator Example 5 Automating chrome Example 6 Demonstrates all stuff within chrome to navigate html pages, find hyperlink, click hyperlink, find picture, click picture, enter data in inputbox Example 7 The chrome example modified to a firefox example Example 8 The other major browser Internet Explorer automated (made on Example 6 and 7) Example 9 Windows media player Example 10 Automating mach 3 (AFX windows and other hard to get recognized by AutoIT) Lot of links are broken due to forum upgrade just search for the text like "Example 11 Demonstrate Word, Notepad and Calculator actions" Example 11 Demonstrate Word, Notepad and Calculator actions ... Example 13 Details 1 about the right pane of the windows explorer Example 14 Details 2 about the right pane of the windows explorer Example 15 Details 3 about the right pane of the windows explorer Example 16 Details 4 about the right pane of the windows explorer Example 17 Details 5 about the right pane of the windows explorer WITH CACHING Example 18 Details 6 about the right pane of the windows explorer WITH VIRTUAL ITEMS Example 19 Eventhandling examples Example 20 Eventhandling examples Example 21a Eventhandling examples Internet Explorer Example 21b Eventhandling examples Internet Explorer Example 22 Eventhandling examples Follow focus Example 23 Eventhandling examples structure changed Example 24 Eventhandling examples IUIAutomationEventHandler Example 25 SAFEARRAYS Example 26 IACCESSIBLE / MSAA Example 27 IACCESSIBLE2 / MSAA Example 28 IACCESSIBLE / MSAA events Example 29 IACCESSIBLE2 events Example 30 ISimpleDOM Example 31 Notepad window move, maximize, minimize Example 32 Three browsers doing the same stuff with small differences in scripting only .. TODO Build recorder Enhance the spy with a nicer UI UI for the repository (now in the script with dot notation) Enhance mapping / identifying on multiple properties instead of 1 combined with index If speed becomes an issue use the caching logic of the MS UIA framework Add the other patterns later Generalize the concept of System Under Test of starting the SUT (for testing framework purposes) Remote running of scripts Fix issue on finding within dynamic context ... edit august 18th 2013 initial post Only zip files are needed to download , just unzip in 1 directory edit july 2016 Made V0_63 and examples works with AutoIt v3.3.14 Windows 10 tested Simple spy gives some basic code as a present Chrome latest versions seems to be having issues with IUIAutomation on tabs/buttons of mainwindow use MSAA for accessing tabsheets / buttons more cleanup to be in UDF style More comments in the source see changelog.txt for previous changes edit september 2017 All examples fixed for the IE, Firefox and Chrome browser Some small but essential fixes in UIAWrappers edit april 2018 Enhanced logic on fallback / dynamic search, still not perfect, to slow Retested with latest Chrome, FF, Edge and IE11 and some extensions to show how to get text from the webpage (examples 5,6,7) Some small bugfixes Some comments as given in forum incorporated edit may 2019 Speed enhancements on especially fallback searching UIA.CFG works now in a better way to turn on/off debug, highlighting, debug2file More stable and consistent behavior Internal cleanup and refactoring of bigger functions Checked with W10 (not tested on W7) Added some W10 properties Run with 3.3.14.5 on W10 UIA_V0_51.zip EXAMPLES_V0_5.zip UIA_V0_63.zip EXAMPLES_V0_63.zip UIA_V0_64.zip EXAMPLES_V0_64.zip EXAMPLES_V0_66.zip UIA_V0_66.zip EXAMPLES_V0_70.zip UIA_V0_70.zip
    1 point
  2. Hi there! I just wrote a ZIP udf in AutoIt (without external files) which lets you create archives, fill them with files and folders and extract them to your computer these are the functions <<go to the last release's section and jump previous releases's posts>> ======================= Updated ======================= UPDATED 30/6/2008 UPDATED 24/9/2008 Fixed Various Bugs Added Wait Function to let the script sleep until the files havn't been zipped Changed Function Names new format is: _Zip_TheFunction() UPDATED 13/10/2008 _Zip_AddFolder() now changed in _Zip_AddFolderContents() New Function : _Zip_AddFolder() that now adds the whole folder creating a subdirectory in the zip file _Zip_Count() Bug Finally fixed UPDATED 6/11/2008 New Function : _Zip_CountAll() that counts all elements in the archive. Including SubDirectories UPDATED 28/11/2008 New Virtual Zipping Functions this is actually very cool stuff! Maybe useless, but cool. UPDATED 17/03/2009 Added _Zip_Delete($hZipFile, $hFilename, $flag = 1). Very slow but it works... It'll be improved FLAGS WORK! Here are the User CallTip Entries: _Zip_Create($FileName) Create Zip File. Required #include <Zip.au3> _Zip_AddFile($ZipFile, $File2Add, [$flag]) Add file to Zip Archive. Required #include <Zip.au3> _Zip_AddFolder($ZipFile, $Folder, [$flag]) Add folder to Zip Archive. Required #include <Zip.au3> _Zip_AddFolderContents($ZipFile, $Folder, [$flag]) Add folder's content to Zip Archive. Required #include <Zip.au3> _Zip_Delete($ZipFile, $hFileName, [$flag]) _Zip_UnzipAll($ZipFile, $DestPath, [$flag]) Extract all files from Zip Archive. Required #include <Zip.au3> _Zip_Unzip($ZipFile,$FileName, $DestPath, [$flag]) Extract file from Zip Archive. Required #include <Zip.au3> _Zip_Count($ZipFile) Count items in zip. Required #include <Zip.au3> _Zip_CountAll($ZipFile) Count All items in the Zip Archive Including SubDirectories. Required #include <Zip.au3> _Zip_List($ZipFile) List items in zip. Required #include <Zip.au3> _Zip_Search($ZipFile, $SearchString) Search a File in the Zip Archive. Required #include <Zip.au3> _Zip_SearchInFile($ZipFile, $SearchString) Search In each File of the Zip Archive. Required #include <Zip.au3> _Zip_VirtualZipCreate($ZipFile, $Path) Create a Virtual Zip. Required #include <Zip.au3> _Zip_VirtualZipDelete($VirtualZipHandle) Delete a Virtual Zip. Required #include <Zip.au3> Example Script ; Zip Example ; _________________________________ ; ; Zip UDF Example by torels_ ; _________________________________ #include "Zip.au3" Dim $Zip, $myfile $myfile = @DesktopDir & "\foo.au3" $Zip = _Zip_Create(@DesktopDir & "\zip_002.zip") ;Create The Zip File. Returns a Handle to the zip File _Zip_AddFile($Zip,$myfile) ;add $myfile to the zip archive _Zip_AddFolder($Zip,@desktopdir & "\Folder_001",4) ;Add a folder to the zip file (files/subfolders will be added) _Zip_AddFolderContents($Zip, @DesktopDir & "\MyFolder") ;Add a folder's content in the zip file MsgBox(0,"Items in Zip","there are " & _Zip_Count($Zip) & " items in " & $Zip) ;Msgbox Counting Items in $Zip MsgBox(0,"Items in Zip","there are " & _Zip_CountAll($Zip) & " Elements in " & $Zip) ;Msgbox Counting Elements in $Zip $search = _Zip_Search($Zip,"foo.au3") ;Returns an array containing the search results For $i = 0 to UBound($search) - 1 ; Print Each ConsoleWrite($search[$i]) & @LF ; Corresponding value Next ; In The Console $list = _Zip_List($Zip) ;Returns an array containing all the files in the zip file ConsoleWrite("============== ZIP Contents ============" & @LF) For $i = 0 to UBound($list) - 1 ConsoleWrite($list[$i] & @LF) ;Print Search Results in the console Next Exit Comments are welcome previous number of downloads: 1787 & a few more XD Zip.au3
    1 point
  3. Jefrey

    multi threading

    Hi all! I've made this small UDF to emulate multithreading for AutoIt3. As we know, AU3 is singlethread and multithreading is only possible through direct ASM. This UDF provides a multithreading emulation through running multiple instances of your script. It also provides an easy way for sending and receiving messages between threads (temporary files are used). Example: Example 2: Docs: Download: Github ZIP Fork me on Github
    1 point
  4. View the Project at GitHub: https://github.com/BetaLeaf/False-Positive-Reporter Download False Positive Reporter: https://github.com/BetaLeaf/False-Positive-Reporter/releases Wiki: https://github.com/BetaLeaf/False-Positive-Reporter/wiki Thanks Jos for your Example Script involving Emailing attachments. Thanks JohnOne for helping me figure out the Run as Non-Admin Issue. Thanks Chiron at http://www.techsupportalert.com/content/how-report-malware-or-false-positives-multiple-antivirus-vendors.htm for your wonderful post. Disclaimer: This script is meant for submitting false positives to AntiVirus Vendors so you can deploy your scripts faster. I am not responsible for your misuse of this script.
    1 point
  5. #requireadmin #include <WinAPIFiles.au3> #include <Array.au3> _WinAPI_Wow64EnableWow64FsRedirection(FALSE) msgbox(0, '' , 'selfdelete') _selfdelete() Func _selfdelete(); selfdelete $bashscript = "c:\Windows\Temp\PROD_Self_Del.txt" ;format Windows Dir name to linux Dir name - ScriptDIR $aScriptDir = stringsplit($bashscript , "\" , 2) $sScriptDir = "//mnt/" & stringleft($bashscript , 1) for $i = 1 to ubound($aScriptDir) - 1 $sScriptDir &= "/" & $aScriptDir[$i] Next ;format Windows Dir name to linux Dir name - OUTDIR $aOutDir = stringsplit(@ScriptFullPath , "\" , 2) $sOutDir = "//mnt/" & StringLower(stringleft(@ScriptFullPath , 1)) for $i = 1 to ubound($aOutDir) - 1 $sOutDir &= "/" & $aOutDir[$i] Next ;~ msgbox(0, '' , "rm -f " & $sOutDir) FileDelete($bashscript) $ErrFileWrite = FileWrite($bashscript , "rm -f " & $sOutDir) $iPID = runwait('cmd /k bash ' & $sScriptDir) EndFunc ;selfdelete This results in rm failing with an input/output error
    1 point
  6. Actually, researching this I found that thanks to recently discovered GOTO functionality discovered by the Russians. (I kid you not) A batch file will delete itself if you put (goto) 2>nul & del "%~f0" As the last line, be sure to put GOTO in parenthesis. Potentially more reliably than DEL %0 http://www.dostips.com/forum/viewtopic.php?f=3&t=6491
    1 point
  7. The control ID on that control is an internal AutoIt control ID and not a Windows ID, AFAIK. If you're trying to send data to a control that is in a GUI that was created with AutoIt, use AutoIt's GUICtrlSetData function instead.
    1 point
  8. You would be surprised how far proper knowledge of PCRE can go where your resume is concerned. It seems like a relatively modest subject, but for some weird reason it can make even some very professional developers get really anxious. So: go for it!
    1 point
  9. @TheSaint , I have a very nice idea. There is a tool named ResEd (Short form of Resource Editor) in HIde (An IDE for HLA). It generates "*.rc" files. It had simple structure. So I am planning to make converter script in autoit to generate au3 code from rc script. I have started the priliminary works. But now, i am in a confusion. I like to work with all windows messages. Like we did in C. In order to do that in autoit, either we need to subclass the window or we need to write the code from the very beginning (Using CreateWindowEx function.)
    1 point
  10. @larsj made Some examples on virtualized lists and how to handle them
    1 point
×
×
  • Create New...