Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Random Email & User Name
#2
Not Solved
There are several ways you can write a function for this...


There are several ways to write function for this....

' If you just want to generate a random string..use this
Code:
FUNCTION GetRandomString(LEN)  
Dim intI, StrS  
Const StartChr ="a", Range = 26  
   Randomize  
   StrS = ""  
   FOR intI = 0 TO LEN-1    
     StrS = StrS + Chr(asc(StartChr) + Rnd() * Range )    
   NEXT  
   GetRandomString = StrS  
END FUNCTION


Now you can use the above function and tweak it according to your objective
Example:for email
Code:
Dim StrE, StrE1, StrE2, StrE3, StrE4, StrEmail
StrE = Call GetRandomString(10)
StrE1 = "@"
StrE2 = Call GetRandomString(5)
StrE3 = "."
StrE4 = Call GetRandomString(5)
StrEmail = StrE&StrE1&StrE2&StrE3&StrE4
Reply


Messages In This Thread
Random Email & User Name - by vbkurutza - 04-16-2008, 09:01 PM
RE: Random Email & User Name - by niranjan - 04-16-2008, 09:36 PM
RE: Random Email & User Name - by newqtp - 04-16-2008, 11:15 PM
RE: Random Email & User Name - by niranjan - 04-17-2008, 12:38 AM
RE: Random Email & User Name - by newqtp - 04-18-2008, 01:23 AM
RE: Random Email & User Name - by niranjan - 04-18-2008, 02:43 AM
RE: Random Email & User Name - by vbkurutza - 05-13-2008, 05:35 PM
RE: Random Email & User Name - by niranjan - 05-14-2008, 03:25 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Send automatic email notification when test run started helmzshelmz 0 1,126 04-03-2020, 07:54 AM
Last Post: helmzshelmz
  How to get input from the user in QTP? shanthiK 10 18,645 08-07-2017, 11:34 PM
Last Post: zunebuggy
  How to attach HTML file to Email Naresh 0 3,091 04-06-2015, 02:04 PM
Last Post: Naresh
  Create a random number starting with an alphabet QTPmate 4 4,303 07-31-2014, 09:29 AM
Last Post: QTPmate
  Help getting Sender Name from Email nidhitaneja 0 2,106 06-15-2014, 09:03 AM
Last Post: nidhitaneja

Forum Jump:


Users browsing this thread: 4 Guest(s)