QTP Functions
**********************************************************************************
Function TimeStamp()
iArr1=Replace(Now,"/","")
iArr2=Replace(iArr1,":","")
iArr3=Replace( iArr2,"AM","")
iArr3=Replace( iArr2,"PM","")
iArr4=Replace(iArr3," ","")
iArr5=Cdbl(iArr4)
iTimeStamp=iArr5-1000000000
TimeStamp=iTimeStamp
End Function
**********************************************************************************
Function TimeStamp(theDate)
TimeStamp=DateDiff("s","01/01/1970 00:00:00",theDate)
End function
**********************************************************************************
How to use the below function in your Test Script
**********************************************************************************
Set oObj=Browser("oBrowser").Page("oPage").Frame("oFrame").WebTable("oWebTable")
Call app_CLA__ClickLink_ChildObject(oObj,1)
**********************************************************************************
Function ClickLink_ChildObject(oObj,iLinkIndex)
Set oDesc1=Description.Create()
oDesc1("innertext").value=oFrame
Set oDesc2=Description.Create()
oDesc2("micclass").value=oWebTable
Set oDesc3=Description.Create()
oDesc3("micclass").value="Link"
oDesc3("index").value=iLinkIndex
Set iLink=oObj.ChildObjects(oDesc1)
iLink(iLinkIndex).click
End Function
**********************************************************************************
**********************************************************************************
Function TimeStamp()
iArr1=Replace(Now,"/","")
iArr2=Replace(iArr1,":","")
iArr3=Replace( iArr2,"AM","")
iArr3=Replace( iArr2,"PM","")
iArr4=Replace(iArr3," ","")
iArr5=Cdbl(iArr4)
iTimeStamp=iArr5-1000000000
TimeStamp=iTimeStamp
End Function
**********************************************************************************
Function TimeStamp(theDate)
TimeStamp=DateDiff("s","01/01/1970 00:00:00",theDate)
End function
**********************************************************************************
How to use the below function in your Test Script
**********************************************************************************
Set oObj=Browser("oBrowser").Page("oPage").Frame("oFrame").WebTable("oWebTable")
Call app_CLA__ClickLink_ChildObject(oObj,1)
**********************************************************************************
Function ClickLink_ChildObject(oObj,iLinkIndex)
Set oDesc1=Description.Create()
oDesc1("innertext").value=oFrame
Set oDesc2=Description.Create()
oDesc2("micclass").value=oWebTable
Set oDesc3=Description.Create()
oDesc3("micclass").value="Link"
oDesc3("index").value=iLinkIndex
Set iLink=oObj.ChildObjects(oDesc1)
iLink(iLinkIndex).click
End Function
**********************************************************************************
Comments