Hello there, I am very new to the product (QTP 9.2) after using Empirix eTester for the past few years. Anyway, I am running some scripts where I need a unique and random user name (any alpha-num value > 5 chars) and email address. I can't seem to find anything in the help on how to do this. Any ideas??
Random Email & User Name
|
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) 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
Hi Niranjan
I've made couple of function when i call them using like 'let take an example adding two no Code: function getsum(a,b) can you plz help where i'm doing wronge. thanks.
Hi,
Right, it should throw error. If you want to get the return value from a function you need to assign it to function name. Example: In your case, instead of sum = a+ b USE getsum = a + b. It will work!!
Hi Niranjan ,
Thanks for the reply.But I still have doubt on that. In code you have used the variable.It's also throwing the same error as i'm getting in my. Code: FUNCTION GetRandomString(LEN) 'you have defined function here Code: Dim StrE, StrE1, StrE2, StrE3, StrE4, StrEmail I'm getting error in your code too same as i'm getting in mine. -Thanks.
Thanks for pointing it out. Its my mistake.
Try this... StrE = GetRandomString(10)
Sorry guys but this is still not working - any more ideas?
Whats the Error you are getting...
|
« Next Oldest | Next Newest »
|
Possibly Related Threads… | |||||
Thread | Author | Replies | Views | Last Post | |
Send automatic email notification when test run started | helmzshelmz | 0 | 1,190 |
04-03-2020, 07:54 AM Last Post: helmzshelmz |
|
How to get input from the user in QTP? | shanthiK | 10 | 18,811 |
08-07-2017, 11:34 PM Last Post: zunebuggy |
|
How to attach HTML file to Email | Naresh | 0 | 3,140 |
04-06-2015, 02:04 PM Last Post: Naresh |
|
Create a random number starting with an alphabet | QTPmate | 4 | 4,414 |
07-31-2014, 09:29 AM Last Post: QTPmate |
|
Help getting Sender Name from Email | nidhitaneja | 0 | 2,143 |
06-15-2014, 09:03 AM Last Post: nidhitaneja |
Users browsing this thread: 1 Guest(s)