QTP 9.5 feature review - Web Extensibility Add-ins
I’ve now had a few days with Quicktest Pro 9.5, and most of that time has been spent with the new Web Extensibility feature. This feature has huge potential. I look forward to seeing how it is accepted by QTP programmers.
The basic idea is that you can create your own QTP add-in. When your add-in is loaded, Quicktest will recognize objects you defined in your add-in and make your custom methods available for them.
After I went through the tutorial in the QuickTest 9.5 documentation, I jumped into creating a Web add-in for a simple DIV in the product I am testing. I called the extension auLogin and the object auLoginForm. The first method I added was SubmitLogin. All it does is click the Login button. This seemed to be an unambitious task, but it proved more difficult than I counted on because I didn’t learn as much as I thought through the tutorial. It is also something much easier done with the single line Browser().Link(”html id:=Submit1_a”).click, but this exercise is about learning, not being efficient.
After all my work, I ended up with the ability to click the Login button with this line: Browser().auLoginForm(”micclass:=auLoginForm”).SubmitLogin
If that doesn’t do much for you, I’m not surprised, but consider that with a bit more coding, I can have a line like this:
Browser().auLoginForm(”micclass:=auLoginForm”).UserLogin “username”, “password”
That line will enter username and password then click the Login button.
Of course I already have a vbscript function that does this; so why would I want to recode everything to use this extension instead? I don’t. Maybe I would if I was doing record and playback, but that isn’t how I work. Instead, I think I will begin seeing the benefit of this on more complex objects like data grids which will have more complex methods. Of course that is all theoretical for me now. I won’t know until I actually roll up my sleeves and code up a more complex web extensibility add-in.
Problems
Until now, I have been purposefully ignoring the problems with how HP implemented web add-in extensibility in QTP 9.5, and there are many problems.
I don’t know Javascript. I suspect that many QTP programmers have dabbled in Javascript but are still much more comfortable coding vbscript. Unfortunately, the web extensions must be written in Javascript. Not knowing Javascript, I have had to learn Javascript at the same time that I learn how to write extensions making it more difficult.
You have to restart Quicktest Pro every time you make a change to an extension. QTP requires a full restart to unload or load an extension. For a novice like myself, this means a lot of restarting to test changes. HP, please work out a way to reload an extension without restarting QTP.
***UPDATE: See below for a great workaround to this***
You have to restart your Browser when you change a javascript file. Basically this is the same problem as above. Once QTP sees an object as an instance of your extension object, even if you restart QTP, the existing object will act as if no changes have been made to your Javascript file. You have to close all instances of the browser before changes will take effect.
Quicktest Pro 9.5 offers no way to debug the functions in your extensions.
Can’t edit extensions using QTP. Quicktest’s editor isn’t designed to work with javascript and xml files, so you are left to find another editor for the extensions.
These problems seem to outweigh the benefits using web extensibility add-ins, but I am an optimist, so I am not giving up yet. For now, you will be able to find me reading a Javascript book.
