Hi, I've been using QTP for about 2 months now and find it very useful but I don't actually write the code I record the script and then amend using "If" statements etc.
However my VB is pretty much non-existant, are you lot all developers turned testers? Where is the best place for me to learn VB and in particular how to build scripts from scratch without having to record? Also is there a standard layout for scripts that call other modules etc? Someone help me as this is getting very confusing thanks
Re: very techy
I for one have never worked as a developer. I did go to college with the intention of becomming a developer but lost interest - frankly I prefer testing. Let someone else build the house; I want to knock it down (to make it better, of course)...
I have worked with SQA Robot and Mercury WinRunner for a few years and now am trying to learn QTP (for about two months, just like you).
I know WinRunner well enough that I can build a script from scratch without recording but I don't. I still record the basics and then enhance the script. It's so much easier.
Others may advise you differently, but for now I advise that you keep recording the scripts and enhancing. Over time you will learn what things need the most enhancing. After your developers put out a new build that breaks your scripts, you will learn patterns to identify in advance what things are most likely to be problems in future builds and you will handle them in advance.
What you do to modify scripts varies from situation to situation so there is no easy answer. For example, I feel safer doing less enhancements (quicker ROI) on a well-established application that is getting its first automation effort, but I will spend more time building chnge-handling into scripts on a brand new appliction still in its first development cycle.
The best thing you can do is keep playing and learning. There are a few books out there on good automation practices but I don't have any specific titles.
As for a standard layout for scripts that call other modules, my best advice is to identify anything you are doing repetitively as early as you can and turn that into a function. The easiest way is to place that repetitive code into another script as a reusable action then call it from your main test scripts. There are other ways but that will get you started.
Also, when chaining multiple scripts together, just remember one rule of thumb: make every script end in the same place it starts. If the script starts with a certain screen open, and certain data loaded, then does a bunch of testing, make sure at the end of the script it closes whatever it opened and reverses any changes so that it ends up with the same certain screen open, and the dame certain data loaded, and nothing changed.
By doing that, you ensure the called script can be inserted into any test anywhere as long as the application meets the starting requirements. Document the starting requirements in comments at the top of the script so ther is no confusion.
This site has several other useful forums. I would particularly suggest the Automated Testing forum, and possibly the Newbie/Fresher/Getting Started and functional Testing forums if you feel the need. Some good information in there, too.
And lastly, ask whatever you need to know here, I'm sure somebody will help you out.
Hope that helps
Re: very techy
There is a good talk on the fundamentals of Scripting tests on Stickyminds - I think it is in the powerpass section form StarWest 2004 by Dion Johnson, of DiJohn Innovative Consulting. I cannot send the talk (licence issues) but I am happy to private mail his contact details, so he can send it to you.
Mary Romero Sweeny has a good book Visual basic for testers, there is a review of it on the following URL with some other useful links on: http://www.compendiumdev.co.uk/books...p?book=vb4test
As Alan says on his site practice is one of the best ways to improve, even more so if you can get mentored by a helpful developer.
I am a bad developer turn tester - though I see myself as a tester who will develop and can put himself in that headspace.
For some ideas on structuring data driven and keyword frame work scripts there are many good sites, I personally tend to Hans Buwalda's TestFrame approach and action words as well as data driven tests where appropriate.
Not sure there is a standard way - it will depend on the tool, the application and the skills of the people doinging it - the context varies as does the most appropriate approach (there should be no judgement on practices with out context).
Re: very techy
I have never worked as a developer either. Like you, I am new to QTP as well. Apart from what Neill and Blake have already said, I would just like to add that in your spare time you should probably play around with the sample application from Mercury (it comes with QTP). I personally haven't done so but I remember doing it with WinRunner when I started off.
As Blake said, it's always a good idea to record-and-enhance when you are learning. Having said that I also suggest that you look at the VB reference that QTP provides and try implementing some of the functions/commands listed there. Even if you know of an easier way to do something using QTP, choose the VB way for doing this (provided you have time to play around). One example of this would be using checkpoint VS using GetROproperty with Reporter.ReportEvent statements.
I have used this approach and slowly but surely am getting more comfortable with VBscript. The reference has some interesting topics like the FileSystemObject, which apart from offering good scripting examples, are also pretty fun to try put into code.
(I'm hiring Software Development Engineers in Test in Seattle, WA)
Re: very techy
Learning VBScript and VB will always help you to enhance your test scripts. They also add better testability.
I would suggest you to learn VBScript and VB. Specially learn ADODB for database access and automation object model exposed by Microsoft Office Products.
I would recommend you to get this book at http://www.oreilly.com/catalog/vbscriptian/, this is a very nice reference book for VBScript.
Access MSDN at msdn.microsoft.com and Microsoft KB site http://support.micorsoft.com , this has a huge information on scripting related issues.
You can get system scripts solution from http://www.microsoft.com/technet/scr...r/default.mspx
Download VBScript Editor from www.adersoft.com, this is nice tool. It has good collection of systems scripts.
Re: very techy
Thank you all so much, you've been great, I'll be buying both of those books recommended and will be using the sites, particularly the W3schools one as you've jogged my memory on that one, that's suppossed to be a very good school.
thanks very much for your help.