Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Vierd problem with static descriptive programming
#1
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.
Reply
#2
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?
Reply
#3
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
Reply
#4
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
Reply
#5
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
Reply
#6
Hi Harish,
Had tried this, but this isnt workingSad

Thanks
Praveena
Reply
#7
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
Reply
#8
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Dynamic descriptive Programming issue in Terminal Emulator cprasad 1 2,492 04-25-2019, 08:17 PM
Last Post: Ankur
  UFT Tool support with Descriptive programming laks 1 2,327 07-05-2018, 05:31 PM
Last Post: Ankur
  UFT Descriptive Programming objects not identified in a secure & private intranet env bugfinder2 1 2,414 06-07-2017, 01:41 PM
Last Post: Ankur
  UFT descriptive programming Browser("creationtime:=-1") not always working SOUMYADEEP 0 3,602 01-20-2017, 01:53 AM
Last Post: SOUMYADEEP
  Inserting variable values into Descriptive Programming Functions eske99 2 4,129 12-18-2015, 01:47 PM
Last Post: vinod123

Forum Jump:


Users browsing this thread: 1 Guest(s)