snomy Posted November 19, 2007 Share Posted November 19, 2007 hi all newbie, question 2 -> is it possible to create your own objects in AutoIt.? in QTP, i often just build a class of all the applications components, such as buttons, input boxes etc., then load this when running the tests. can this be done in AutoIt? cheers snomy Link to comment Share on other sites More sharing options...
weaponx Posted November 19, 2007 Share Posted November 19, 2007 AutoIt itself isn't OOP, it can only call outside objects and dll's. Alternatively you can gather all of your control ids into an array. Link to comment Share on other sites More sharing options...
zfisherdrums Posted November 19, 2007 Share Posted November 19, 2007 (edited) Hello snomy,I've used QTP in the past and while I appreciate its GUI mapping capabilities, it is such a behemoth to use.I've created scripts to scrape relevant data from the GUI and persist it to a data store (i.e., Excel Workbook because of the ease of editing data ). The data that I capture is primarily:Window TitleWinow ClassWindow IDWindow Instance ( the 'NN' in 'ClassNameNN' )StyleExStylePositionWindow TextFrom within the data store document, I assign a "FriendlyName" to any/all controls that I will be using in my regression/functionality test(s). A separate script is then used to reference these "FriendlyNamed" controls via ADO. Additionaly, I try to wrap generic actions ( i.e., Click, TypeText, Select, etc ) within custom functions that lookup those values in the data store/gui map. That way, I can call the generic function, pass in the "FriendlyNamed" control, and let the function determine the appropriate action to take based on the class ( in case additional actions are required for certain controls ).It would probably be helpful to show you an example. I'm working on a Test Automation Framework ( never done, eh? ) that utilizes all this functionality. If you're interested, I can share what I've got with you. Let me know if you are.Zach... Edited November 19, 2007 by zfisherdrums Identify .NET controls by their design time namesLazyReader© could have read all this for you. Unit Testing for AutoItFolder WatcherWord Doc ComparisonThis here blog... Link to comment Share on other sites More sharing options...
snomy Posted November 19, 2007 Author Share Posted November 19, 2007 Yeah I would be v interested in seeing how this works, my only main curiosity is how you read the objects in from a spreadsheet, but overall it sounds very interesting. I really appreciate you coming back to me, and look forward to investigating this further. Thanks. snomy Link to comment Share on other sites More sharing options...
snomy Posted November 19, 2007 Author Share Posted November 19, 2007 hi also i have a question regarding your calculator script, i got it working and i have one query regarding it, i can see your adept in programming so its gonna be interesting learning from you for sure! the thing is, in your scripts where u state: Func TestSetup() StartApp() EndFunc when i use this setup in my own program test.au3, it doesnt work or invoke the software, if i comment it out like so, it works? ;Func TestSetup() StartApp() ;EndFunc i get a little flash of something near the system tray, but it appears for a split second...?? ____________________________________ so my StartApp looks like this in testfunc.au3: #include <Testing.au3> #Include <test.au3> Func StartApp() Run( "calc.exe" ) EndFunc i just dont get it? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now