Jump to content

Building a library of objects


snomy
 Share

Recommended Posts

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

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 Title
  • Winow Class
  • Window ID
  • Window Instance ( the 'NN' in 'ClassNameNN' )
  • Style
  • ExStyle
  • Position
  • Window Text
From 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 by zfisherdrums
Link to comment
Share on other sites

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

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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...