Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Issues with Browser Name which has Pipe Symbol (|)
#1
Not Solved
Hi,

QTP fails to recognize the object's parent(Browser) if the Browser name is like "Yahoo Site | Mail" (pipe symbol in Browser name). I am dynamically capturing Browser name and Page Title and executing the script.

Sample Script:
-------------
Code:
SignUpObjName = "test.gif"
BrowserName=Browser("micclass:=Browser").GetROProperty("name")
PageName=Browser("micclass:=Browser").Page("micclass:=Page").GetROProperty("title")
Browser("name:=" & BrowserName).Page("Title:="& PageName).Image( "file name:=" &SignUpObjName).Click


I got the following Run Error:

"Cannot find the "[Image]" Object's parent "[Browser]" (class Browser). VErify that parent properties match an object currently displayed in your application"

Note1: If we have Object Repository for same Browser (say "Yahoo Site | Mail") we didn't get any error and execution is successful.

Note2: Script works fine for other Browsers which don't have Pipe symbol in their name.

Please share your ideas on this.

Vijay
Reply
#2
Not Solved
Pipe means OR in regular expression. So QTP is taking it as Yahoo site OR Mail. Escape pipe with backslash and it would work fine.
Code:
Ex: "Yahoo Site \| Mail"
Want to fast track your QTP/UFT Learning? Join our UFT Training Course
Reply
#3
Not Solved
Thank you very much. Its working fine now.
Reply
#4
Not Solved
Can you tell me how did you make this work...

it will be great if you can show the script to do this.

Thanks in advance
Reply
#5
Not Solved
Hi UjwalaK,

The solution is there in Ankur's Post.
Regularise the text in your OR.

Reply
#6
Not Solved
Hi UjwalaK
you can use the below coding for the same,

Code:
SignUpObjName = "117112.jpg"
BrowserName = Replace(Browser("micclass:=Browser").GetROProperty("name"),"|","\|")
PageName=Replace(Browser("micclass:=Browser").Page("micclass:=Page").GetROProperty("title"),"|","\|")
Browser("name:=" & BrowserName).Page("Title:="& PageName).Image( "file name:=" &SignUpObjName).Click


Thanks,
Srikanth
Reply
#7
Not Solved
Hi ,

I was also trying the above code. On an application I was trying to click on a link " Home". I have used descriptive programming and efined it with enough properties.

Code:
BrowserName=Browser("micclass:=Browser").GetROProperty("name")
                PageName=Browser("micclass:=Browser").Page("micclass:=Page").GetROProperty("title")

Browser("name:=" &BrowserName).Page("Title:="&PageName).Link(Obj_home).Click
but last line doesnt work. It says Link object properties matches with some other objects. But I added all mandatory prop, but still no luck
Reply
#8
Not Solved
Can anyone reply my query???
Reply
#9
Not Solved
scenario is that, I have a home button. I need to click this buton on page1 first and page 2 second.

Now when I object spy on first page I see page title prop is diff.
same thig happens for page also.

Hence I used regular expression as I didnt wanted to add those objects in Object repository.

Code:
If Browser("name:=Mobile.*","Creationtime:=0").Page("tilte:=Mobile.*").Link(Obj_Mobiles).Exist(2)   then
        Browser("name:=Mobile.*","Creationtime:=0").Page("tilte:=Mobile.*").Link(Obj_Mobiles).Click

This also didnt work. Please note I have used descriptive programming for Obj_Mobiles
Reply
#10
Not Solved
What was the error dispalyed ??
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Sad If/then Statement issues Carver2469 2 3,991 11-03-2015, 03:44 PM
Last Post: vinod123

Forum Jump:


Users browsing this thread: 1 Guest(s)