Google Search Results
You arrived here after searching for the following phrases:
Click a phrase to jump to the first occurrence, or return to the search results.
Background
It’s no secret I’m not a fan of QTP’s code-editor - it lacks intellisense, meaningful autocomplete, code folding, and many other “Must” features; And while QTP 10 will improve the situation, the IDE’s core problems will remain. In addition to the IDE’s shortcomings, QTP’s reliance on VBScript cripples it in many key areas such as object-oriented programming (tests, actions and GUI classes could inherit from one-another), debugging capabilities (ever wanted to skip a few lines while debugging), threading, live monitoring, error handling, and much more.
After a few years of passively complaining about these problems, I’ve decided to act, and see if I could somehow write my QTP tests in Visual Studio .Net. If I managed to pull that off, I would solve both the IDE problems (Visual Studio provides a wonderful – though not perfect - IDE, even in its free Express versions), as well as the deeper programming problems (.Net languages are fully fledged object-oriented language, with rich error handling, debugging, and other cool features).
In addition to these obvious benefits, additional perks await in Visual Studio. For example, hiding the automation code from snoopy clients (you could just compile the entire test into an executable form); built it .net extendibility, and more.
There are significant downsides as well (which may make the whole operation not worth your while) – adding another layer of code always causes problems and complexities; you cannot do this via QC; QTP’s automation agent randomly goes crazy and hangs the entire system, you’ll have to learn complex code techniques in order to take advantage of the inherent benifits in .Net; etc.
Having said that, I think it’s an idea worth exploring, even if only as an interesting adventure.
Registeration is FREE, quick and private.
You can either Register or Login if you have already registered
From a proof of concept to a viable framework
While all this is fine as a proof of concept, the technique fails miserably as a general framework – it requires a separate variable slot for each GUI object, has no error handling for launching QTP (what if there’s an unsaved opened test?), has no methods for reaching child objects or expressing object hierarchies, and is generally inadequate for serious use.
As I’ve mentioned earlier, it is possible to build a more robust and sophisticated bridge that will provide cover all these issues and more. This was just meant as a simple, straightforward proof of concept.
On a personal note – I’ve been working with a fully fledged bridge for several weeks, and have been written some of my tests in Visual Studio, and the results are spectacular. If you have the necessary programming skills, I recommend the experience, even if only to open your mind to greater possibilities. Are you ready to step through the looking-glass?
Enjoy.
Posted in QTP Hacks, Yaron Assa's Blog

Yaron Assa





February 8th, 2009 at 11:53 am
Very cool! hope to see more examples about this in the future :)
February 8th, 2009 at 5:25 pm
Useful one.
http://funandknowledge.blogspot.com/2009/01/to-retrieve-column-names-from-database.html
http://sqlqueriescollection.blogspot.com/2009/01/sql-query-to-retrieve-nth-highest.html
February 9th, 2009 at 3:18 pm
Fortunately for those who do not want the complexities of building a bridge between Visual Studio and QTP, there is still Test Design Studio (http://www.patterson-consulting.net). It provides a Visual Studio-like experience for QTP development, and we are constantly adding new features. The 1.7 release of TDS, for instance, will include runtime syntax checking and more advanced language error checking that passes syntax checks (like duplicate name declarations in the same scope).
Visual Studio still offers many features that TDS cannot provide, so it would be great to have a fully-functional technique to build our tests with a more robust editor and language.
Good work, Yaron!
February 9th, 2009 at 3:45 pm
I would like to support what Boyd Patterson has said. TDS is an amazing IDE for QTP and Winrunner, which provides ample features, programming tools, and documentation marvels.
It does all that (and more), without requiring any ugly and complex workarounds that the VS< ->QTP requires.
February 10th, 2009 at 10:26 pm
And for those who can’t afford purchasing VS or TDS, there’s the open source SharpDevelop.
February 10th, 2009 at 11:06 pm
Yaron, your very last paragraph says that you have developed in VS “a fully fledged bridge” and “have been written some of my tests in Visual Studio, and the results are spectacular”. Can you share this VB.NET solution with anyone? I have been given the task to write QTP tests and I would prefer to do it in .NET and NOT VBScript.
February 11th, 2009 at 9:42 am
Yaron:
Very interesting..this really gives respite from the daily mundane tasks…..
February 11th, 2009 at 10:20 am
swiontle - Right now my code is implemented in a proprietary project, so I can’t share it.
If you have some focused questions I’ll be more than happy to help.
Also - if there’s real demand, we might consider releasing a mature version as a project.
Having said that, Meir has developed an amazing framework - MySystem, which greatly improves the flexibility and stability of QTP VBscript code.
I recommend you read some of what he wrote about it - here and here.
February 11th, 2009 at 11:03 pm
Thanks so much Yaron! Appreciate it!
February 12th, 2009 at 7:13 am
Good idea. I’ve all but abandoned QTP due to many of the shortcomings you noted, but continue to read your article because of the insights you ( and others ) bring to the table.
I did want add caution on one item:
“For example, hiding the automation code from snoopy clients (you could just compile the entire test into an executable form)”
Since .NET code is compiled to MSIL for JIT compiling, it is extremely easy to reverse engineer the code; all the way down to the variable names, class definitions, etc. ildasm ( provided by Microsoft ) and Lutz Roeder’s .NET Reflector are tools that provide this capability. If security/intellectual property is a concern, obfuscation needs to be considered.
Otherwise, I applaud any effort to tame this cumbersome tool.
February 12th, 2009 at 7:51 am
Hey zfisherdrums,
Can’t you use the obfuscater for that (render the code unreachable?).
February 12th, 2009 at 7:58 am
Yes, that was my intent: obfuscation needs to be considered where security/intellectual property is a concern. But we cannot simply check the “Obfuscate” option and expect that the issue is resolved.
I have not checked in some time, but I recall that the community edition obfuscation provided in VS 2005 is minimal when compared to other editions/.NET obfuscation technologies. Variable names are mangled, but internal logic and data structures are still viewable using the tools described.
February 12th, 2009 at 8:06 am
OK zfisherdrums, Thanks a lot for the clarification!
February 16th, 2009 at 4:22 am
Hey everybody, since we are on this topic of using .NET to write automation tests, is there any tool out there that will let me do this? I’ve just been moved as a Software Engineer to a Tester/Software Developer role, and I don’t want to lose my .NET skills by writing all my automated tests in VBScript. Also, do any of you have any advice for me is this career change? I’m worried that the testing field doesn’t pay as well, and maybe isn’t as illustrious as a developer. Thanks so much!!!
February 19th, 2009 at 5:44 am
看不懂
February 20th, 2009 at 6:34 am
Hello, Yaron,
Very interested in this article, and I just had a try. I can achieve what you described in this article, but can’t do that in C#. I don’t know how to access the Environment of Test, which appear just as a Object in C#. Any hint about that?
Regards,
Jimmy Jin
February 26th, 2009 at 8:04 am
This is awesome..!!!!!
And this is what just in my back of mind, is it possible to make a bridge in between .net and qtp at any level,
but blocked..
So i personally can understood its importance, pretty well….
Yaron Assa, You seems genius here..
Thanks!!!
March 5th, 2009 at 8:27 am
Swiontle,
Don’t stress about the “testing” role stigma. As testers such as the ones in this forum prove automation to be a viable mechanism for testing such as we have at our company, more and more companies are searching for people with our skills, and prepared to pay big money for them. To be honest, I haven’t looked back since making the change. 10 years ago I was a developer with 3 years experience, but my career has flourished since moving to testing. Your development skills should enhance your ability to create complex testing solutions, which is what is required of enterprise solutions these days. Most advanced automation engineers I know are earning substantially more than their software engineer equivalents.
March 31st, 2009 at 8:18 pm
jkrohn, thanks so much for the encouragement. They also have given me CM responsibilities on VSTS 2008. That’s been a real challenge as well (branching, merging, versioning), but like you said, its all making me a better “overall” developer / tester / QA person. Here’s a question to this group: If you knew your management was going to push you towards VSTS Tester Edition 2010 in about 12 months, how would you write your automated tests within QTP to leverage code reusage? Thanks so much to all of you that replied to my comment on my career change.
June 10th, 2009 at 5:50 am
It is very good.
May 27th, 2010 at 11:15 pm
Look like some one building the bridge already
http://jqtp.blogspot.com/
June 28th, 2010 at 11:32 pm
daveSm — I’ll believe it when I see it. :)