Geeks With Blogs

News QTP and Stuff
Theo Moore Questions... Morphology? Longevity? Incept dates?
Been working on the tool I mentioned before to manage the object repository in a previous post. I dutifully fired up the VB.Net IDE, and began work. However, there are some snags:

1) The tool API is a COM object. Not a big deal, but a little unfortunate. Shouldn't be a problem, I was thinking.
2) The API was written to work in VBScript...not VB.Net

Issue 1) isn't a huge deal, but 2) is. Why? Well, there are two things causing me grief:
1) One of the methods off of the main object accepts two optional parameters. If the first one (which indicates where the object should located) if "Null" or "Empty", then it knows to use the root of the repository. Ok, fair enough...I need to access the root in order to populate some controls to allow for drilling down. Cool. Well, the VBScript version will either accept an undeclared variable (if Option Explicit not on), or will accept a declared variable or constant set to "Null". Naturally, VB.Net has issue with this. I tried passing an object set to nothing, but the method won't return the collection of object I expected. It didn't error out, but it didn't give me anything either. Clearly a problem in communication.

2) The VBScript version will allow me to do this:
Set oCollection = .GetChildren(ROOT) 'Where ROOT is a constant = null. It works perfectly in VBScript (or the QTP shell), but in VB.Net, we have an issue. Apparently, the same line (syntactical differences met) making method in .net has a problem: the IDE reports "Expression will not return a value".

So, I am not sure which of the two above is causing the problem. I've considered writing a wrapper to allow me to send something more palatable to, but that's a lot of trouble....

Anyone got a copy of VS6 lying around??? Posted on Tuesday, January 3, 2006 2:49 PM | Back to top

Comments on this post: QTP: Obj Repository tool fun

Comments are closed.
Comments have been closed on this topic.
Copyright © Theo Moore | Powered by: