Micro Focus QTP (UFT) Forums
qtp vbscript issue - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: qtp vbscript issue (/Thread-qtp-vbscript-issue)



qtp vbscript issue - nikithak - 02-20-2014

Hi, I need to create random number for txtlatitude column using vbscript and it should be automatically generated the random values for that column.
Please help, here is my QTP code

Code:
Browser("Untitled Page").Page("Untitled Page").WebEdit("txtuser_id").Set "1"
Browser("Untitled Page").Page("Untitled Page").WebEdit("txtdatetime").Set "05:12"
Browser("Untitled Page").Page("Untitled Page").WebEdit("txtlatitude").Set "212.25463"
Browser("Untitled Page").Page("Untitled Page").WebEdit("txtlongitude").Set "45.32546"
Browser("Untitled Page").Page("Untitled Page").WebButton("Save").Click
Browser("Untitled Page").Page("Untitled Page_2").Sync
Browser("Untitled Page").Close



RE: qtp vbscript issue - guin.anirban - 02-24-2014

Boss two Options are there:

1. Randomize
Print rnd

2. Set UID = CreateObject("Scriptlet.Typelib")
DELAYID=UID.GUID
Print DELAYID
Set UID = Nothing

Choice is your's....