Micro Focus QTP (UFT) Forums
Vierd problem with static descriptive programming - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Vierd problem with static descriptive programming (/Thread-Vierd-problem-with-static-descriptive-programming)



Vierd problem with static descriptive programming - Shwethareddy - 10-17-2012

Hi,

The below piece of code works fine with any other website(change in title values) and am not able to get the result for my AUT. Below is the Code & Err msg. Please let me know ur inputs @ the earliest.

Code:
Set alllink=Description.Create
alllink("micclass").value="Link"

Set objlink=Browser("title:=CCAMS | Home.*","micclass:=Browser").Page("title:=CCAMS | Home | 1.1.34").ChildObjects(alllink)
msgbox objlink.count

Err-Msg:Cannot find the [Page] objects Parent [Browser] class (Browser).Verify that parent properties match an object currently dispalyed in your application.


RE: Vierd problem with static descriptive programming - manabh - 10-17-2012

Code:
Set objlink=Browser("title:=CCAMS | Home.*","micclass:=Browser").Page("title:=CCAMS | Home | 1.1.34").ChildObjects(alllink)


Are you sure about the string that you are using?


RE: Vierd problem with static descriptive programming - Ankesh - 10-17-2012

Can you chk if the below works? If yes then then there is something wrong with the text u r passing for browser and page.

Code:
Set objlink=Browser("title:=.*").Page("title:=.*").ChildObjects(alllink)

Regards,
Ankesh


RE: Vierd problem with static descriptive programming - Shwethareddy - 10-18-2012

Hi Ankesh,
Above code is working but giving a different result when i add objects to object repository and run the script.
Also 1 more question -When i spy for browser object below are the object properties listed, please let me know how exactly to pass
the values in the code. Browser-
title:CCAMS | Home | 1.1.34 - Windows Internet Explorer
name:CCAMS | Home | 1.1.34
hwd:67194

Thanks a ton
Praveena


RE: Vierd problem with static descriptive programming - harishshenoy - 10-18-2012

Try this out:

Code:
Set alllink=Description.Create
alllink("micclass").value="Link"

Set objlink=Browser("title:=CCAMS.*").Page("title:=CCAMS.*").ChildObjects(alllink)
msgbox objlink.count
This might do...... the error might be because of '|' symbol... u might need to suppress the special characters so that qtp recognize them...

Thanks ,
Harish Shenoy


RE: Vierd problem with static descriptive programming - Shwethareddy - 10-18-2012

Hi Harish,
Had tried this, but this isnt workingSad

Thanks
Praveena


RE: Vierd problem with static descriptive programming - Ankesh - 10-18-2012

One query here, if you are adding the object to OR, why u need to go with DP. you can directly use the Object as in OR. Just regularize the text/title property.

anyways, you try the below code.

| is a special character in regular expression which indicates OR. I have used escape character \.

Code:
Set objlink=Browser("title:=CCAMS \| Home\|.*").Page("title:=CCAMS \| Home \|.*").ChildObjects(alllink)
Regards,
Ankesh


RE: Vierd problem with static descriptive programming - Shwethareddy - 10-19-2012

Hi Ankesh,
The reason am not using OR is, have 67 webpages in the AUT for which i got to get the links. To parameterize the test am going for DP.

With the below code am gettng error number - (-2147467259)
Any more info plz..
Code:
et alllink=description.Create
alllink("micclass").value="Link"

Set objlink=Browser("name:=CCAMS \| Home \| 1.1.35","micclass:=Browser").Page("name:=CCAMS \| Home \| 1.1.35.*").ChildObjects(alllink)
msgbox Err.Number

Thanks
Praveena