
zfisherdrums
Active Members-
Posts
382 -
Joined
-
Last visited
Profile Information
-
Location
Nashville, TN
-
WWW
http://testingzach.blogspot.com/
Recent Profile Visitors
1,655 profile views
zfisherdrums's Achievements

Universalist (7/7)
6
Reputation
-
phuocvo88 reacted to a post in a topic: Unit Testing in AutoIt...sorta
-
argumentum reacted to a post in a topic: LazyReader(c)
-
errandfox reacted to a post in a topic: Towards approximating a 'yield' statement
-
justdoit123 reacted to a post in a topic: Any framework for the automation testing
-
Script Exiting Unexpectedly
zfisherdrums replied to zfisherdrums's topic in AutoIt General Help and Support
Jos, Thanks for the reply. Yes, that was my mistake. Been awhile since I was in this language. Falsely assumed that Exit was scoped to the Function, not the script itself. Again - pure foolishness on my part. Zach -
mLipok reacted to a post in a topic: Mini File Watcher Utility
-
Just figured it out. Erasing my foolishness from the internet.
-
allenljwan reacted to a post in a topic: Identify .NET controls by their Name
-
How Call in Autoit function Library (dll) C#
zfisherdrums replied to kmeleon's topic in AutoIt General Help and Support
If you want to keep it in C#, you should check out the Unmanaged Exports project. It is a project template that allows native consumption of managed DLLs without the typical compilation/deployment overhead. You decorate your methods with a specific attribute and...voila! Have I used it before? No. Just Google-foo. May be worth checking out. Best, Zach... -
MySQL-Connection with AutoIt
zfisherdrums replied to FloSG's topic in AutoIt General Help and Support
Is 'SQLOLEDB' the correct Provider for MySQL? Can an IP address be specified as the Data Source? doesn't it need a database name? Are line continuation characters valid in a connection string? -
Automating Tab controls in C# ?
zfisherdrums replied to GlowTube's topic in AutoIt General Help and Support
Hello, GlowTube! Just a thought: $a = ControlFocus ("[NAME:tabPage_Startup]", "", "[CLASS:Button; TEXT:A Large Button]") The line above is interesting to me, inasmuch as it specifies a window search using a .NET name. I would interested to know if you had any success confirming this method of targeting the app. As a test, what happens when you run this: WinMove( "[NAME:tabPage_Startup]", "", 1, 1 ) Would this code move the app's window to position 1,1? If so, you've taught me something and I am grateful. If not, perhaps this is the root cause for ControlClick's failure. Zach... -
It isn't an answer, but here's some further details that might explain why this behavior exists. http://social.msdn.microsoft.com/Forums/en/isvvba/thread/3333e18b-cef3-4d78-b47a-6916a1b2d84c Zach...
-
Admittedly, this topic may be of questionable value for most, but someone may have need of it in the future. At my work, we have a significant amount of effort sunk into an Excel spreadsheet. This spreadsheet was augmented with classes that used workbook data to call out web services. In addition, the domain we were working in (testing financial software) required that these workbooks be usable by actuaries. In other words, the functionality we needed had to be built into a single deliverable file. As the project progressed, it became apparent that we could leverage these classes in our other testing efforts - those that use scripting languages. Now that you know why I'd be suggesting this path - as opposed to programming something in C# - here is how one might proceed to expose these objects to outside interests. In Excel, open the VBA Editor (alt-F11) and create a class. You will need to set the class 'Instancing' property to "2 - PublicNotCreatable". Inside the class, we'll create a method called "Test" Public Sub Test(sArg As String) MsgBox sArg End Sub This class would contain the functionality you want to expose to outside consumers, e.g. an AutoIT Script. Now, create a module. Inside the module, create a function similar to this: Public Function MyClassFactory() As MyClass Set MyClassFactory = New MyClass End Function This is required because our Class cannot be directly created. This function is responsible for creating an instance and returning it. Save the workbook. In this example, I saved it to my desktop as "test.xls". Below is an example of how to use the class in AutoIt. #include <excel.au3> $oXl = _ExcelBookAttach( @DesktopDir & "\test.xls" ) If Not IsObj( $oXl ) Then ConsoleWrite( "FAIL" & @CRLF) Exit EndIf Dim $obj = $oXl.Application.Run( "MyClassFactory" ) $obj.Test( "Hello, World" )
-
LurchMan, Untested and possibly brittle, but should work in theory. Let me know if it doesn't. #include <excel.au3> Opt ("WinTitleMatchMode", 2) Func GetNumExcelProcess() $_aProcesses = ProcessList( "Excel.exe" ) return $_aProcesses[0][0] EndFunc $oExcel = _ExcelBookOpen (@ScriptDir & "\macro.xls", 0) $oExcel.Run ("Start") ; Establish a baseline number of known Excel processes $iNumExcelProcess = GetNumExcelProcess() ; Periodically test for changes in the number of Excel processes While ( $iNumExcelProcess = GetNumExcelProcess() ) Sleep (100) WEnd _ExcelBookClose ($oExcel, 0, 0) Exit Zach...
-
FWIW, the beta GUI exposes quite a bit to through Active Accessibility. X-Lite Beta[window - Visible] {Action: ?, Description: ?, Role: window, Value: ?} |--- X-Lite Beta - [text - Visible] {Action: ?, Description: ?, Role: text, Value: ?} |--- NAMELESS[push button - Visible] {Action: Press, Description: ?, Role: push button, Value: ?} |--- NAMELESS[push button - Visible] {Action: Press, Description: ?, Role: push button, Value: ?} |--- NAMELESS[client - Visible] {Action: ?, Description: ?, Role: client, Value: ?} | '--- NAMELESS[popup menu - Visible] {Action: ?, Description: ?, Role: popup menu, Value: ?} | |--- X-Lite[menu item - Visible] {Action: Open, Description: ?, Role: menu item, Value: ?} | |--- View[menu item - Visible] {Action: Open, Description: ?, Role: menu item, Value: ?} | |--- Contacts[menu item - Visible] {Action: Open, Description: ?, Role: menu item, Value: ?} | |--- Actions[menu item - Visible] {Action: Execute, Description: ?, Role: menu item, Value: ?} | '--- Help[menu item - Visible] {Action: Open, Description: ?, Role: menu item, Value: ?} |--- NAMELESS[client - Visible] {Action: ?, Description: ?, Role: client, Value: ?} | '--- NAMELESS[combo box - Visible] {Action: Expand, Description: ?, Role: combo box, Value: ?} | |--- NAMELESS[editable text - Invisible] {Action: ?, Description: ?, Role: editable text, Value: ?} | '--- Available[list item - Invisible] {Action: Double Click, Description: ?, Role: list item, Value: ?} |--- NAMELESS[push button - Invisible] {Action: Press, Description: ?, Role: push button, Value: ?} |--- NAMELESS[push button - Invisible] {Action: Press, Description: ?, Role: push button, Value: ?} |--- NAMELESS[push button - Visible] {Action: Press, Description: ?, Role: push button, Value: ?} |--- NAMELESS[push button - Visible] {Action: Press, Description: ?, Role: push button, Value: ?} |--- NAMELESS[push button - Invisible] {Action: Press, Description: ?, Role: push button, Value: ?} |--- NAMELESS[push button - Visible] {Action: Press, Description: ?, Role: push button, Value: ?} |--- NAMELESS[client - Visible] {Action: ?, Description: ?, Role: client, Value: ?} | |--- NAMELESS[client - Visible] {Action: ?, Description: ?, Role: client, Value: ?} | | |--- NAMELESS[editable text - Visible] {Action: ?, Description: ?, Role: editable text, Value: ?} | | | |--- NAMELESS[scroll bar - Invisible] {Action: ?, Description: ?, Role: scroll bar, Value: 0} | | | '--- NAMELESS[scroll bar - Invisible] {Action: ?, Description: ?, Role: scroll bar, Value: 0} | | |--- NAMELESS[push button - Visible] {Action: Press, Description: ?, Role: push button, Value: ?} | | |--- NAMELESS[push button - Invisible] {Action: Press, Description: ?, Role: push button, Value: ?} | | '--- NAMELESS[text - Invisible] {Action: ?, Description: ?, Role: text, Value: ?} | |--- Call[push button - Visible] {Action: Press, Description: ?, Role: push button, Value: ?} | '--- NAMELESS[push button - Visible] {Action: Press, Description: ?, Role: push button, Value: ?} |--- NAMELESS[client - Visible] {Action: ?, Description: ?, Role: client, Value: ?} | |--- NAMELESS[push button - Visible] {Action: Press, Description: ?, Role: push button, Value: ?} | | |--- 1[text - Visible] {Action: ?, Description: ?, Role: text, Value: ?} | | '--- NAMELESS[text - Visible] {Action: ?, Description: ?, Role: text, Value: ?} | |--- NAMELESS[push button - Visible] {Action: Press, Description: ?, Role: push button, Value: ?} | | |--- 2[text - Visible] {Action: ?, Description: ?, Role: text, Value: ?} | | '--- ABC[text - Visible] {Action: ?, Description: ?, Role: text, Value: ?} | |--- NAMELESS[push button - Visible] {Action: Press, Description: ?, Role: push button, Value: ?} | | |--- 3[text - Visible] {Action: ?, Description: ?, Role: text, Value: ?} | | '--- DEF[text - Visible] {Action: ?, Description: ?, Role: text, Value: ?} | |--- NAMELESS[push button - Visible] {Action: Press, Description: ?, Role: push button, Value: ?} | | |--- 4[text - Visible] {Action: ?, Description: ?, Role: text, Value: ?} | | '--- GHI[text - Visible] {Action: ?, Description: ?, Role: text, Value: ?} | |--- NAMELESS[push button - Visible] {Action: Press, Description: ?, Role: push button, Value: ?} | | |--- 5[text - Visible] {Action: ?, Description: ?, Role: text, Value: ?} | | '--- JKL[text - Visible] {Action: ?, Description: ?, Role: text, Value: ?} | |--- NAMELESS[push button - Visible] {Action: Press, Description: ?, Role: push button, Value: ?} | | |--- 6[text - Visible] {Action: ?, Description: ?, Role: text, Value: ?} | | '--- MNO[text - Visible] {Action: ?, Description: ?, Role: text, Value: ?} | |--- NAMELESS[push button - Visible] {Action: Press, Description: ?, Role: push button, Value: ?} | | |--- 7[text - Visible] {Action: ?, Description: ?, Role: text, Value: ?} | | '--- PQRS[text - Visible] {Action: ?, Description: ?, Role: text, Value: ?} | |--- NAMELESS[push button - Visible] {Action: Press, Description: ?, Role: push button, Value: ?} | | |--- 8[text - Visible] {Action: ?, Description: ?, Role: text, Value: ?} | | '--- TUV[text - Visible] {Action: ?, Description: ?, Role: text, Value: ?} | |--- NAMELESS[push button - Visible] {Action: Press, Description: ?, Role: push button, Value: ?} | | |--- 9[text - Visible] {Action: ?, Description: ?, Role: text, Value: ?} | | '--- WXYZ[text - Visible] {Action: ?, Description: ?, Role: text, Value: ?} | |--- NAMELESS[push button - Visible] {Action: Press, Description: ?, Role: push button, Value: ?} | | |--- *[text - Visible] {Action: ?, Description: ?, Role: text, Value: ?} | | '--- NAMELESS[text - Visible] {Action: ?, Description: ?, Role: text, Value: ?} | |--- NAMELESS[push button - Visible] {Action: Press, Description: ?, Role: push button, Value: ?} | | |--- 0[text - Visible] {Action: ?, Description: ?, Role: text, Value: ?} | | '--- NAMELESS[text - Visible] {Action: ?, Description: ?, Role: text, Value: ?} | '--- NAMELESS[push button - Visible] {Action: Press, Description: ?, Role: push button, Value: ?} | |--- #[text - Visible] {Action: ?, Description: ?, Role: text, Value: ?} | '--- NAMELESS[text - Visible] {Action: ?, Description: ?, Role: text, Value: ?} |--- NAMELESS[client - Visible] {Action: ?, Description: ?, Role: client, Value: ?} | |--- NAMELESS[push button - Invisible] {Action: Press, Description: ?, Role: push button, Value: ?} | |--- No accounts are enabled.[text - Visible] {Action: ?, Description: ?, Role: text, Value: ?} | |--- To setup an account, go to: [text - Visible] {Action: ?, Description: ?, Role: text, Value: ?} | |--- Account Settings[text - Visible] {Action: ?, Description: ?, Role: text, Value: ?} | |--- NAMELESS[text - Invisible] {Action: ?, Description: ?, Role: text, Value: ?} | |--- NAMELESS[text - Invisible] {Action: ?, Description: ?, Role: text, Value: ?} | |--- NAMELESS[text - Invisible] {Action: ?, Description: ?, Role: text, Value: ?} | |--- NAMELESS[text - Invisible] {Action: ?, Description: ?, Role: text, Value: ?} | |--- NAMELESS[text - Invisible] {Action: ?, Description: ?, Role: text, Value: ?} | |--- NAMELESS[text - Invisible] {Action: ?, Description: ?, Role: text, Value: ?} | '--- Get VoIP service.[text - Invisible] {Action: ?, Description: ?, Role: text, Value: ?} |--- NAMELESS[radio button - Visible] {Action: Check, Description: ?, Role: radio button, Value: ?} |--- NAMELESS[radio button - Visible] {Action: Check, Description: ?, Role: radio button, Value: ?} |--- NAMELESS[radio button - Invisible] {Action: Check, Description: ?, Role: radio button, Value: ?} |--- NAMELESS[client - Visible] {Action: ?, Description: ?, Role: client, Value: ?} | |--- NAMELESS[push button - Visible] {Action: Press, Description: ?, Role: push button, Value: ?} | |--- NAMELESS[editable text - Visible] {Action: ?, Description: ?, Role: editable text, Value: ?} | | |--- NAMELESS[scroll bar - Invisible] {Action: ?, Description: ?, Role: scroll bar, Value: 0} | | '--- NAMELESS[scroll bar - Invisible] {Action: ?, Description: ?, Role: scroll bar, Value: 0} | |--- NAMELESS[push button - Invisible] {Action: Press, Description: ?, Role: push button, Value: ?} | |--- NAMELESS[push button - Visible] {Action: Press, Description: ?, Role: push button, Value: ?} | |--- NAMELESS[push button - Visible] {Action: Press, Description: ?, Role: push button, Value: ?} | |--- NAMELESS[outline - Visible] {Action: ?, Description: ?, Role: outline, Value: ?} | '--- Contacts loading...[text - Invisible] {Action: ?, Description: ?, Role: text, Value: ?} |--- NAMELESS[client - Invisible] {Action: ?, Description: ?, Role: client, Value: ?} |--- NAMELESS[client - Invisible] {Action: ?, Description: ?, Role: client, Value: ?} |--- NAMELESS[push button - Visible] {Action: Press, Description: ?, Role: push button, Value: ?} '--- Enter name or number[text - Invisible] {Action: ?, Description: ?, Role: text, Value: ?}
-
Test tool limitations AND bad UI design (from a testing perspective). Controls on form are owner-drawn. The underlying executable does not export any functions to test below the GUI, nor does it appear to expose a COM interface. It appears to be a native Win32 app, so had no luck importing it as an assembly into a .NET driver. Active Accessibility did not reveal any 'secrets' either. If you have any luck beyond sendkeys(...) and coordinated mouseclicks, I'd love to know how - but I don't see this app cooperating with any UI Automation that I'm familiar with. Just my 2 cents. Good luck! Zach...
-
Free comparing files puzzle.
zfisherdrums replied to MisterC's topic in AutoIt General Help and Support
Hello, MisterC Dictionaries can be helpful here. #Region ============== FUNCTIONS ============== ; This function is only a stub for FileRead. ; It mimics what FileRead would return if the ; four text files actually existed on the system. Func MockFileRead( $sPath ) Switch $sPath Case "1.txt" return StringSplit( "ABCD", "", 2 ) Case "2.txt" return StringSplit( "CDEF", "", 2 ) Case "3.txt" return StringSplit( "EFGH", "", 2 ) Case "4.txt" return StringSplit( "GHIJ", "", 2 ) EndSwitch EndFunc Func AddUniqueToolsToToolBox( $arrTools, ByRef $dctToolBox ) For $tool in $arrTools If Not ( $dctToolBox.Exists( $tool )) Then $dctToolBox.Add( $tool, "" ) EndIf Next EndFunc Func DumpToolBox( $dctToolBox ) For $key in $dctToolBox.Keys ConsoleWrite( $key ) Next ConsoleWrite( @CRLF ) EndFunc #EndRegion ; ; ============== MAIN ============== Dim $dctProjectToolBox = ObjCreate( "Scripting.Dictionary" ) Dim $arrToolsInFileOne = MockFileRead( "1.txt" ) Dim $arrToolsInFileTwo = MockFileRead( "2.txt" ) Dim $arrToolsInFileThree = MockFileRead( "3.txt" ) AddUniqueToolsToToolBox( $arrToolsInFileOne, $dctProjectToolBox ) AddUniqueToolsToToolBox( $arrToolsInFileTwo, $dctProjectToolBox ) AddUniqueToolsToToolBox( $arrToolsInFileThree, $dctProjectToolBox ) DumpToolBox( $dctProjectToolBox ) ; Console: ABCDEFGH Dim $arrToolsInFileFour = MockFileRead( "4.txt" ) AddUniqueToolsToToolBox( $arrToolsInFileFour, $dctProjectToolBox ) DumpToolBox( $dctProjectToolBox ) ; Console: ABCDEFGHIJ -
Automating a .NET Context Menu
zfisherdrums replied to Rawling's topic in AutoIt General Help and Support
This is reaching back a bit, so forgive me if the details are sketchy. When I had to automate context menus on WinForm apps - and I had to use AutoIT - then I had to utilize Microsoft Active Accessibility. There is a DLL available for download somewhere on the forum; search for "MSAA". I had to obtain a reference to the context menu's active accessibility interface. To do this, I had to get the window handle; all popup menus have a window class of #32768 if I recall correctly. Bear in mind that the context menu is not owned by the WinForm client or control, but rather belongs to the desktop. Once you get the window reference, you can get the Active Accessibility interface. Children nodes in the Accessibility Tree can expose propeties based on their type. Menu items have a (de)selected, (dis|en)abled property. I think the best way to start is to download these tools from Microsoft and observe the context menu. Sorry I can't give a working solution, but this should give you some direction. Zach... -
Try removing the '$' in front of '$playUrl'. Current: autoit.ControlSend("Open URL", "", "Edit1", $playUrl) Updated: autoit.ControlSend("Open URL", "", "Edit1", playUrl)
-
Hey automation, I don't work that much in Ruby, so I apologize if this doesn't help you out. By looking at the code, '$playUrl' refers to a global variable, while the defined function receives a parameter entitled 'playUrl'. If the global variable isn't defined, that may explain why it is entering a blank value. Zach...
-
Automating website with Ajax
zfisherdrums replied to phinney's topic in AutoIt General Help and Support
I may be mis-reading the FFLoadWaitASYNC code, but it appears to be triggered by the text in the status bar. AJAX may not necessarily update the status bar text during processing. If I'm mis-representing that functionality, my apologies in advance. I would write a function to wait until the Submit button has certain attributes, i.e. 'display=block'. I would determine these attributes through the use of the IE Developer toolbar (for IE) and/or Firebug (for FF). When we wait for the button to have these attributes set, we can be reasonably assured that the script can continue.