The online community for software testing & quality assurance professionals
 
 
Calendar   Today's Topics
Sponsors:
Lost Password?

Home
BetaSoft
Blogs
Jobs
Training
News
Links
Downloads



Testing Tools >> HP Functional Testing / Mercury QuickTest Pro / QTP

Pages: 1
shafeeq
Member


Reged: 03/25/08
Posts: 72
Browser "creationtime" property in QTP 9.2
      #584763 - 08/10/09 05:00 AM

Hi

did any one used creationtime property for browser.
I am trying to get the value as per qtp help it should return 0 if one browser is open else 1,2,3 for multiple browsers in open state

I am using folloing code

set objD = Description.Create
objD("micclass").value="Browser"
set gBrowser = Desktop.ChildObjects(objD)

For intctr = 0 to gBrowser.Count -1

Msgbox gbrowser(intctr).getroproperty("creationtime")
Next

Note : I have multiple browsers open
and value i am getting is some big number like 4.87170524439547E-300

any suggestions or tips welcome

Regards
Shafeeq


Post Extras: Print Post   Remind Me!   Notify Moderator  
saikumar999
Junior Member


Reged: 09/22/05
Posts: 232
Loc: Dallas,US
Re: Browser "creationtime" property in QTP 9.2 [Re: shafeeq]
      #584901 - 08/10/09 05:29 PM

check your runtime properties and In my view you cannot retrive the values of ordinal identifiers using GetROProperty.

--------------------
Sai
Certified HP consultant


Post Extras: Print Post   Remind Me!   Notify Moderator  
Tarun LalwaniModerator
Veteran


Reged: 07/21/05
Posts: 15329
Loc: Milwaukee, Wisconsin
Re: Browser "creationtime" property in QTP 9.2 [Re: saikumar999]
      #584940 - 08/10/09 11:25 PM

Yes, ordinal identifier can only be retrieved using GetTOProperty and only when they have been used to identify the object. There is no way for you to retrieve the creationtime of an existing browser using GetROProperty

--------------------
Regards,
Tarun
** First ever technical novel - And I thought I knew QTP! **
** Download QTP Unplugged 2nd Edition eBook for FREE **

KnowledgeInbox RSS


Post Extras: Print Post   Remind Me!   Notify Moderator  
Drunlar
Newbie


Reged: 11/22/11
Posts: 1
Re: Browser "creationtime" property in QTP 9.2 [Re: shafeeq]
      #691810 - 11/22/11 11:24 AM

You have to look up the CT backwards by creating descriptive objects. Here is the solution to the issue that I use. In your case you aren't using handles you can however adapt that quite easily:



'****m* ClassBrowserCtrl/GetBrwsrCTByHWnd
'================================================================================================
'* NAME:
'* GetBrwsrCTByHWnd(hWnd)
'------------------------------------------------------------------------------------------------
'* DESCRIPTION:
'* Use the supplied handle to find the creation time of the Browser
'------------------------------------------------------------------------------------------------
'* CALL STACK (The Child Parent / Bread Crumbs) order:
'* Parent: FILE/Lib_General/ClassBrowserCtrl
'------------------------------------------------------------------------------------------------
'* INPUT(S):
'* * hWnd = The handle of the current browser session being tested.
'------------------------------------------------------------------------------------------------
'* OUTPUT(S):
'* * On SUCCESS = The CreationTime of the browser associated with the supplied handle
'* * On FAILURE = -1
'------------------------------------------------------------------------------------------------
'* NOTE(S):
'------------------------------------------------------------------------------------------------
'* USAGE EXAMPLE(S):
'================================================================================================
'* SOURCE
Public Function GetBrwsrCTByHWnd(hWnd)
Dim oBrwsr, aBrwsrChilds, i
Set oBrwsr = Description.Create()
oBrwsr("micclass").Value = "Browser"

Set aBrwsrChilds = Desktop.Childobjects(oBrwsr)

GetBrwsrCTByHWnd = -1
On Error Resume Next
For i = 0 to aBrwsrChilds.Count - 1
'If an error happens that means an invalid handle was supplied
If Browser("CreationTime:=" & i).GetROProperty("hwnd") = hWnd Then
GetBrwsrCTByHWnd = i
Exit Function
End If
If Err Then
Err.Clear
Exit Function
End If
Next
Err.Clear
On Error Goto 0
End Function


Post Extras: Print Post   Remind Me!   Notify Moderator  
kiran_pol
Member


Reged: 09/07/08
Posts: 46
Re: Browser "creationtime" property in QTP 9.2 [Re: shafeeq]
      #691821 - 11/22/11 01:14 PM

You can use this code as well

set objD = Description.Create
objD("micclass").value="Browser"
set gBrowser = Desktop.ChildObjects(objD)

For intctr = 0 to gBrowser.Count -1

If Browser("micClass:=Browser","CreationTime:="&intctr&"").Exist(2) Then
msgbox "CreationTime" &intctr
End If
Next


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
0 registered and 106 anonymous users are browsing this forum.

Moderator:  IanFraser, Rajkumar_Rajangam, thorwath, TReddy, AJ, Tarun Lalwani, mwsrosso 

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Topic views: 5740

Rate this topic

Jump to

Contact Us | Privacy statement SQAForums

Powered by UBB.threads™ 6.5.5