Garnesh, I want to try that, where the replace will go in the code.

Browser("title:=.*").Page("title:=.*").webEdit("name:=dataElementForm.title"
).Set *Replace*(Mid("abc_def_ghijklm_nopqrstuv",1+4*Int(5*Rnd()),4))

I did try replacing Trim with Replace, but its giving wrong argument error.


On Tuesday, November 19, 2013 12:11:58 PM UTC-5, Ganesh muralidharan wrote:
>
> George, if the space is within the string then trim will not work better 
> to use Replace and replace space with underscore.
>
>
> On Tue, Nov 19, 2013 at 10:38 AM, Wayne Hirata 
> <[email protected]<javascript:>
> > wrote:
>
>> My sample used the TRIM function. The TRIM function trims off spaces.
>>
>> And don't forget the RANDOMIZE statement. 
>>
>> QTP comes with a VBSCRIPT help file, script.chm, or something like that.
>>
>>
>> On Tue, Nov 19, 2013 at 5:10 AM, George Popkhadze 
>> <[email protected]<javascript:>
>> > wrote:
>>
>>> Thanks Wayne,
>>> I kind a got an idea what this script does.
>>> How to eliminate spaces in the string, i cant have spaces, only 
>>> underscores is allowed
>>>
>>> Thanks
>>>
>>>
>>> On Tue, Nov 19, 2013 at 1:50 AM, Wayne Hirata 
>>> <[email protected]<javascript:>
>>> > wrote:
>>>
>>>> Randomize
>>>>
>>>> Browser("title:=.*").Page("title:=.*").webEdit("name:=
>>>> dataElementForm.title").Set Trim(Mid("Mr  Ms  MissDr 
>>>>  Capt",1+4*Int(5*Rnd()),4))
>>>>
>>>>
>>>> On Mon, Nov 18, 2013 at 11:35 AM, george p <[email protected]<javascript:>
>>>> > wrote:
>>>>
>>>>> Great, thanks.
>>>>> Can you also share how entire script would look like?
>>>>>
>>>>>
>>>>> On Monday, November 18, 2013 11:46:28 AM UTC-5, Wayne Hirata wrote:
>>>>>>
>>>>>> Chr(65 + Int(26 * Rnd())) & Chr(97 + Int(26 * Rnd())) & Chr(48 + 
>>>>>> Int(10 * Rnd()))
>>>>>>
>>>>>> That's one upper case letter and one lower case letter and one digit. 
>>>>>>
>>>>>> Here is a random length string that has 3 to 7 upper case letters.
>>>>>> For i = 1 To 3 + Int(5 * Rnd())
>>>>>> a = a & Chr(65 + Int(26 * Rnd()))
>>>>>> Next
>>>>>>
>>>>>>
>>>>>> On Sunday, November 17, 2013 7:41:53 AM UTC-10, george p wrote:
>>>>>>>
>>>>>>>
>>>>>>> Hi,
>>>>>>> i have web app that creates forms.
>>>>>>> I need to enter text in the form title, name and description fields 
>>>>>>> and save the form.
>>>>>>> Form title and name is unique and I was thinking to set random 
>>>>>>> unique string and/or integer.
>>>>>>> How can I do this in Descriptive programing, i am not using OR at 
>>>>>>> all.
>>>>>>>
>>>>>>> I would like to do thi 4-5 times to create multiple forms.
>>>>>>>
>>>>>>> Browser("title:=.*").Page("title:=.*").webEdit("name:=
>>>>>>> dataElementForm.title").Set "some title"
>>>>>>> Browser("title:=.*").Page("title:=.*").webEdit("name:=
>>>>>>> dataElementForm.name").Set "some Name"
>>>>>>> Browser("title:=.*").Page("title:=.*").webEdit("name:=
>>>>>>> dataElementForm.shortDescription").Set "descriptions"
>>>>>>>
>>>>>>>
>>>>>>>  -- 
>>>>> -- 
>>>>> You received this message because you are subscribed to the Google
>>>>> "QTP - HP Quick Test Professional - Automated Software Testing"
>>>>> group.
>>>>> To post to this group, send email to 
>>>>> [email protected]<javascript:>
>>>>> To unsubscribe from this group, send email to
>>>>> [email protected] <javascript:>
>>>>> For more options, visit this group at
>>>>> http://groups.google.com/group/MercuryQTP?hl=en
>>>>>  
>>>>> --- 
>>>>> You received this message because you are subscribed to a topic in the 
>>>>> Google Groups "QTP - HP Quick Test Professional - Automated Software 
>>>>> Testing" group.
>>>>> To unsubscribe from this topic, visit 
>>>>> https://groups.google.com/d/topic/mercuryqtp/cawASIZTUbA/unsubscribe.
>>>>> To unsubscribe from this group and all its topics, send an email to 
>>>>> [email protected] <javascript:>.
>>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>>
>>>>
>>>>  -- 
>>>> -- 
>>>> You received this message because you are subscribed to the Google
>>>> "QTP - HP Quick Test Professional - Automated Software Testing"
>>>> group.
>>>> To post to this group, send email to [email protected]<javascript:>
>>>> To unsubscribe from this group, send email to
>>>> [email protected] <javascript:>
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/MercuryQTP?hl=en
>>>>  
>>>> --- 
>>>> You received this message because you are subscribed to a topic in the 
>>>> Google Groups "QTP - HP Quick Test Professional - Automated Software 
>>>> Testing" group.
>>>> To unsubscribe from this topic, visit 
>>>> https://groups.google.com/d/topic/mercuryqtp/cawASIZTUbA/unsubscribe.
>>>> To unsubscribe from this group and all its topics, send an email to 
>>>> [email protected] <javascript:>.
>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>
>>>
>>>  -- 
>>> -- 
>>> You received this message because you are subscribed to the Google
>>> "QTP - HP Quick Test Professional - Automated Software Testing"
>>> group.
>>> To post to this group, send email to [email protected]<javascript:>
>>> To unsubscribe from this group, send email to
>>> [email protected] <javascript:>
>>> For more options, visit this group at
>>> http://groups.google.com/group/MercuryQTP?hl=en
>>>  
>>> --- 
>>> You received this message because you are subscribed to a topic in the 
>>> Google Groups "QTP - HP Quick Test Professional - Automated Software 
>>> Testing" group.
>>> To unsubscribe from this topic, visit 
>>> https://groups.google.com/d/topic/mercuryqtp/cawASIZTUbA/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to 
>>> [email protected] <javascript:>.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>
>>  -- 
>> -- 
>> You received this message because you are subscribed to the Google
>> "QTP - HP Quick Test Professional - Automated Software Testing"
>> group.
>> To post to this group, send email to [email protected]<javascript:>
>> To unsubscribe from this group, send email to
>> [email protected] <javascript:>
>> For more options, visit this group at
>> http://groups.google.com/group/MercuryQTP?hl=en
>>  
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "QTP - HP Quick Test Professional - Automated Software Testing" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
>
> -- 
> Regards,
>
>
> Ganesh Muralidharan
> 'God Never Forgets' 
>

-- 
-- 
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en

--- 
You received this message because you are subscribed to the Google Groups "QTP 
- HP Quick Test Professional - Automated Software Testing" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to