07-15-2014, 06:15 AM
Hi,
Could any one help me to create a random number starting with alphabet like A123456,
Regards.
Could any one help me to create a random number starting with alphabet like A123456,
Regards.
|
Create a random number starting with an alphabet
|
|
07-15-2014, 06:15 AM
Hi,
Could any one help me to create a random number starting with alphabet like A123456, Regards.
07-24-2014, 05:22 PM
Hi,
does the alpahbet remain consant or it is random as the numbers?
07-30-2014, 04:22 AM
Hi Ankesh,
Thanks for your time and reply to the post. Alphabet will be changing as well. I would like to select from an array of 10 alphabets. Regards.
07-30-2014, 04:11 PM
Hi QTPmate,
Its simple.You can do it in a couple of ways.I am just presenting the logic. For alphabets you would be getting it from Array so no problem for that. For numbers what you can do is , you can use vbscript "Time" function which would return 3:26:54 , which you can split using ":" as delimiter , get it in array , then append array(0) , array(1) , which would give you a random number. Here is the code which you can change accordingly Code: str_randomno=Time
Dim aftersplitting
aftersplitting=split(str_randomno,":")
print aftersplitting(0)&aftersplitting(1)&left(aftersplitting(2),2)Thanks, Gangadhar
07-31-2014, 09:29 AM
Thanks for help Gangadhar appreciated.
|
|
« Next Oldest | Next Newest »
|
| Possibly Related Threads… | |||||
| Thread | Author | Replies | Views | Last Post | |
| Random Values from Drop-Down | profqa | 5 | 6,919 |
12-06-2013, 09:01 AM Last Post: basanth27 |
|
| Creating Random String | SomeIntern | 0 | 5,583 |
08-21-2013, 09:10 PM Last Post: SomeIntern |
|
| Random Number generator and verification problem | jinnah | 4 | 11,257 |
09-28-2012, 04:03 AM Last Post: jinnah |
|
| How to choose a random no from list | alwarselvam | 0 | 3,462 |
12-24-2011, 08:28 AM Last Post: alwarselvam |
|
| Starting QTP as a Windows Service | adi_sesha | 2 | 4,924 |
10-06-2010, 03:01 PM Last Post: Pallavii |
|