Geeks With Blogs
Theo Moore Questions... Morphology? Longevity? Incept dates?

I’ve been building some test components for our products lately, and noticed something…unusual. I often use descriptive programming to get around issues with environment, since typically our environments have very similar code. Some of the items I use are very reliable; things like the <TITLE> tag are usually pretty good, and don’t change often here.

However, I noticed something interesting with this process. We have a page that simply isn’t recognized via descriptive programming. I can record and play it back (just to debug my code; not for use), but using the title property to get at it descriptively won’t work. Now, naturally, I am driven to figure out why. I don’t like not knowing.

While I am on the topic, note that the error produced by this “confused” QTP is “General Run Error” which translates to mean “I have fallen, I don’t know why, and I can’t get up”.

I altered the title field a few times, and this is what I have determined: descriptive programming can’t seem to handle more than one space at a time. We have a page where the title is broken up with the | character and multiple spaces. An example of this might be “Start Page | Here”. If you removed the spaces, it works just fine. At first I thought perhaps the pipe character was troubling it, but it seems to work fine when I use “StartPage|Here”.

So, when you have space issues, you might have to use some alternative property to get the page. I’ve had success with building an expected URL dynamically, and using it with my descriptive programming. Not as eloquent perhaps, but much more reliable in our architecture.

Also, I’ve been working on an alternative to using datatables involving disconnected ADO recordsets. More on that to come.

Posted on Wednesday, March 22, 2006 5:47 AM | Back to top


Comments on this post: QTP: An issue with descriptive programming

# re: QTP: An issue with descriptive programming
Requesting Gravatar...
I've learned to hate General Run Error. I spent about 30 minutes today trying to figure out why WebUtil.GetCookies always causes a General Run Error. I finally gave up and figured out a way to avoid having to get the cookies.
Left by Will on Mar 22, 2006 11:55 AM

# re: QTP: An issue with descriptive programming
Requesting Gravatar...
ROFL!!!! That's how I deal with things like that, also. Only way sometimes. :-)

Theo
Left by Theo Moore on Mar 22, 2006 11:56 AM

# re: QTP: An issue with descriptive programming
Requesting Gravatar...
I just accidentally discovered that the Page element is optional. I forgot to put a page in this line:

oBrowser.WebEdit("html id:=User_ID").Set sUserName

And it actually worked. This could be another way around your title issue.

Now that I think about this, it makes sense that Page would be optional. After all, there can only be one page loaded in each browser (even in QTP 9.0, tabbed browsing isn't supported).
Left by Will on Mar 22, 2006 12:48 PM

# re: QTP: An issue with descriptive programming
Requesting Gravatar...
I wonder if, instead of hard-coding the spaces, you could just do a "\s*". I'd be afraid that there are weird spaces and things buried in the HTML, and without proportional fonts you just can't tell.

I've definitely had trouble with leading/trailing spaces in the regexen I use for programmatic descriptions. It's caused me to rely on the dreaded "dot star" more often than I'd like.

http://www.perlmonks.com/?node_id=24640
Left by Marcus on Mar 24, 2006 9:19 AM

# re: QTP: An issue with descriptive programming
Requesting Gravatar...
ya man i too face similar type problems. while recording its recorded properly but when m rollback by running its throughing some error like object is not recognizing...... But in othere system it works properly. so what we can say this probs ..... is it environment problem ya some qtp9.0 issue ya some thing else like some new features is there but we dont knw hoe to handle it????
Left by PrasantKumar Pradhan on Apr 18, 2007 10:00 AM

# re: QTP: An issue with descriptive programming
Requesting Gravatar...
showing error "General run Error"
Left by prabhakar on Apr 20, 2007 4:21 AM

# re: QTP: An issue with descriptive programming
Requesting Gravatar...
Actually I don't know about "Descriptive Scripting in QTP"
Please guide How can I learn it for web applications and also give an example for login window
Left by Rajesh on Apr 23, 2007 1:52 AM

# re: QTP: An issue with descriptive programming
Requesting Gravatar...
Cannot get RemoteAgent's ClassID for test type <QUICKTEST_TEST>
what does it mean?
Left by kiran on Jun 08, 2007 5:26 PM

# re: QTP: An issue with descriptive programming
Requesting Gravatar...
I have the same problem "Cannot get RemoteAgent's ClassID for test type <QUICKTEST_TEST>" when I try to execute a test from Quality Center. It seems that I am missing a QTP plugin that I am unable to find anywhere..
Left by Constantin on Oct 10, 2007 1:37 PM

# re: QTP: An issue with descriptive programming
Requesting Gravatar...
How to uniquily identify the link object when the name , URL, Href all are the same ?which property we can use instead of using Index...and any othe method to solve this problem.?
plz.. tell ASAP
Thanks.
Anup
Left by anup on Oct 23, 2007 6:50 AM

# Cannot get RemoteAgent's ClassID for test type <QUICKTEST_TEST>
Requesting Gravatar...
What is the underlying problem when you get the error: Cannot get RemoteAgent's ClassID for test type <QUICKTEST_TEST>. How do you resolve this?
Left by InDoubt on Nov 03, 2007 7:32 AM

# Testing web page URLs with QTP
Requesting Gravatar...
How do you check for broken links with QTP. I am fairly new to this and need some advise about how the code is written in QTP to check for suppose 50 URLs if they work or not.
Left by Abhy on Feb 28, 2008 4:53 PM

# re: QTP: An issue with descriptive programming
Requesting Gravatar...
Answer for RemoteAgent's ClassID for test type <QUICKTEST_TEST>.

On the Test Director main page, click "Test Director Add In Page."

Then click "More Test Director Add-ins"

You need (what should be) the very first addin: "QTP Quick test Add-In"
Left by prem on Mar 11, 2008 6:39 AM

# re: QTP: An issue with descriptive programming
Requesting Gravatar...
Answer for RemoteAgent's ClassID for test type <QUICKTEST_TEST>.

On the Test Director main page, click "Test Director Add In Page."

Then click "More Test Director Add-ins"

You need (what should be) the very first addin: "QTP Quick test Add-In"
Left by Prem Tito on Mar 11, 2008 6:41 AM

# Cannot get RemoteAgent's ClassID for test type <QUICKTEST_TEST>
Requesting Gravatar...
I am able to connect to QC from QTP (We are able to save tests from QTP to QC) but its not working the other way.
When I try to run a test from QC which was saved using QTP I am getting an error "Cannot get RemoteAgent's ClassID for test type <QUICKTEST_TEST>". I installed the QC addin but during the installation of QTP addin there was some error. Will that be the reason?

And with QC addin alone will QTP be able to connect to QC?
Left by Harish on Mar 12, 2008 5:29 AM

# re: QTP: An issue with descriptive programming
Requesting Gravatar...
Hello can anyone solve for descriptive programming in qtp how to write a progran to open a web page
Left by Raja on Mar 15, 2008 9:31 AM

# re: QTP: An issue with descriptive programming
Requesting Gravatar...
@Raja - answer = yes. People that bothered to RTFM can do it...try to RTFM...
Left by Coder on Apr 03, 2008 11:18 PM

Your comment:
 (will show your gravatar)
 


Copyright © Theo Moore | Powered by: GeeksWithBlogs.net | Join free