Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem with GetROProperty
#1
Not Solved
Hello,

i've a problem with closing certain windows.
I want to close all browser windows with a specified url, regardless if the window is opend bevor the script is started or at run time of the script.

So i use following code:
Code:
While Browser("Creationtime:=" & CreationTime).Exist
    URL = Browser("Creationtime:=" & CreationTime).GetROProperty("URL")
    If instr(URL, Mask) Then
        Browser("Creationtime:=" & CreationTime).Close
    Else
        CreationTime = CreationTime + 1
    End If
Wend

Most windows can be closed without any problem.
But there is always a window that remains open. A page with a pdf-file, something like http://www.test.com/test.pdf
If i want to get the url of such a page, the URL is always blank?

Can someone help me, please?
Thank you
Reply
#2
Not Solved
maybe you must use getroproperty on the object page, child of browser.
If i use object spy on "http://www.test.com/test.pdf" i see the property url (of object page, not browser) valorized with "http://www.test.com/test.pdf"

[with object spy I never see 'url' as property of browser... are you sure that the property to call is not 'title'?]
Reply
#3
Not Solved
Thx, if i use 'title' i can close pages which contain pdf-files. But now i've got a new problem.
I've updatet from QTP 9.2 to QTP 9.5 and the solution with the CreationTime doesn't work anymore and it seems to be a infinite loop now.

Does somebody know a solution?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to use GetRoProperty for title svsaug6 2 9,704 08-26-2013, 03:36 AM
Last Post: Novemberrain81
  .Object vs GetROProperty? Archens 0 3,337 03-28-2012, 10:26 PM
Last Post: Archens
  QTP gives wrong value through GetRoProperty rahul3tech 2 4,061 02-03-2012, 10:14 PM
Last Post: rajpes
  How to use GetROProperty mv8167 8 50,165 05-04-2011, 09:52 PM
Last Post: mv8167

Forum Jump:


Users browsing this thread: 1 Guest(s)