QTP: An issue with descriptive programming

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 @ Wednesday, March 22, 2006 5:47 AM

Print

Comments on this entry:

# re: QTP: An issue with descriptive programming

Left by Will at 3/22/2006 11:55 AM
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.

# re: QTP: An issue with descriptive programming

Left by Theo Moore at 3/22/2006 11:56 AM
Gravatar
ROFL!!!! That's how I deal with things like that, also. Only way sometimes. :-)

Theo

# re: QTP: An issue with descriptive programming

Left by Will at 3/22/2006 12:48 PM
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).

# re: QTP: An issue with descriptive programming

Left by Marcus at 3/24/2006 9:19 AM
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

# re: QTP: An issue with descriptive programming

Left by PrasantKumar Pradhan at 4/18/2007 10:00 AM
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????

# re: QTP: An issue with descriptive programming

Left by prabhakar at 4/20/2007 4:21 AM
Gravatar
showing error "General run Error"

# re: QTP: An issue with descriptive programming

Left by Rajesh at 4/23/2007 1:52 AM
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

# re: QTP: An issue with descriptive programming

Left by kiran at 6/8/2007 5:26 PM
Gravatar
Cannot get RemoteAgent's ClassID for test type <QUICKTEST_TEST>
what does it mean?

# re: QTP: An issue with descriptive programming

Left by Constantin at 10/10/2007 1:37 PM
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..

# re: QTP: An issue with descriptive programming

Left by anup at 10/23/2007 6:50 AM
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

# Cannot get RemoteAgent's ClassID for test type <QUICKTEST_TEST>

Left by InDoubt at 11/3/2007 7:32 AM
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?

# re: QTP: An issue with descriptive programming

Left by Snape at 12/10/2007 12:06 AM
Gravatar
I too have an issue with the descriptive programming.

QTP is not recognizing the page object when the object is created descriptively, while when the same properties are put in the object repository (by recording), QTP can identify the page. I have been working quite a while on this issue, unable to resolve it.

The discussiion thread up there seems to be of some help. I will see if I can get something out of this.
__________________________________

Well my descriptive script was of the following type:

Set abcbrowser = description.Create
Set homepage = description.Create
set resdirectorypge = description.create
set resdirtab = description.create

abcbrowser("Version").value = "internet explorer 6"

homepage("url").value = "http://abc-anupam01.us.int.abc.com:1000/abc"
homepage("title").value = ".: abc :."

resdirectorypge("url").value = "http://abc-anupam01.us.int.abc.com:1000/abc/abcW/abcW_index?body=abcW_rdMain"
resdirectorypge("title").value = ".: abc :."

resdirtab("html tag").value = "TD"
resdirtab("innertext").value = "Resort Directory"
resdirtab("innerhtml").value = "Resort Directory"

Browser(abcbrowser).Navigate ("http://abc-anupam01.us.int.abc.com:1000/abc/")
anupam1 = Browser(abcbrowser).Page(homepage).Exist(10)
msgbox anupam1
Browser(abcbrowser).Page(homepage).WebElement(resdirtab).Click
anupam2 = Browser(abcbrowser).Page(resdirectorypge).Exist(10)
msgbox anupam2
________________________________
When the above script was run, for
"messagebox anupam2", always the "False" value was thrown.
_________________________________

Now instead of writing it descriptively, I recorded the same. Object repository had the correct object properties, same as above.

And the page exists function returned the true value.

# Testing web page URLs with QTP

Left by Abhy at 2/28/2008 4:53 PM
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.

# re: QTP: An issue with descriptive programming

Left by prem at 3/11/2008 6:39 AM
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"

# re: QTP: An issue with descriptive programming

Left by Prem Tito at 3/11/2008 6:41 AM
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"

# Cannot get RemoteAgent's ClassID for test type <QUICKTEST_TEST>

Left by Harish at 3/12/2008 5:29 AM
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?

# re: QTP: An issue with descriptive programming

Left by Raja at 3/15/2008 9:31 AM
Gravatar
Hello can anyone solve for descriptive programming in qtp how to write a progran to open a web page

# re: QTP: An issue with descriptive programming

Left by Coder at 4/3/2008 11:18 PM
Gravatar
@Raja - answer = yes. People that bothered to RTFM can do it...try to RTFM...
Comments have been closed on this topic.
«December»
SunMonTueWedThuFriSat
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910