Getting Unique String in QTP
Class clsString
Public Function fun_GetStringWithTimeStamp(strFristString)
strTime = Replace(Time(),”:”,””)
fun_GetStringWithTimeStamp = strFristString&strTime
End Function
End Class
data = RandomString(265)
WScript.Echo Len(data)
WScript.Echo data
Function RandomString( ByVal strLen )
Dim str
Const LETTERS = “abcdefghijklmnopqrstuvwxyz0123456789”
Randomize()
For i = 1 to strLen
RndNumber = Int((Len(LETTERS)- 1 + 1) * Rnd + 1)
str = str & Mid( LETTERS, RndNumber, 1 )
Next
RandomString = str
End Function
Class clsString
Public Function fun_GetStringWithTimeStamp(strFristString)
strTime = Replace(Time(),”:”,””)
fun_GetStringWithTimeStamp = strFristString&strTime
End Function
End Class
Internet Explorer Operations used in QTP
The Below code illustrate the Internet Explorer Operations
‘$Filename: clsIE.vbs
‘$Description: class consists various IE browser operations
‘$Author: Deep Routhu
Read more…QTP Connection to Access DB
The below code illustrate the connection to Access Data Base.Here we are using the class concept as it helps us to organize the code.Class clsAccess‘ @HELP‘ @description: This class is defined to handle database operations.‘ @END
Executing Soap ui from VBS file
The below code illustrate to execute the the Soap UI project to execute.It executes all the test suites in the Soap UI Project‘Calls to the functionExecuteSoapUI “127.0.0.1”‘Function to execute the soap UI ProjectPublic Function ExecuteSoapUI(IPaddress)
Approach to Automation Project
Well Automation is a separate project just like the development project. There are couple of factors to decide to go for a Automation.