Add the RANDOMIZE statement to the beginning of your script before you execute any other code. Don't forget the RANDOMIZE statement.
On Tue, Nov 19, 2013 at 8:30 AM, George Popkhadze <[email protected]>wrote: > Wayne, > Everytime I run this script, I get the "Dr" as a title > > > Browser("title:=.*").Page("title:=.*").webEdit( > "name:=dataElementForm.title").Set Trim(Mid("Mr Ms MissDr > Capt",1+4*Int(5*Rnd()),4)) > > I am confused why its only come as 2 letters > > > > > On Tue, Nov 19, 2013 at 12:11 PM, Ganesh muralidharan <[email protected] > > 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]>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]>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]>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]>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] >>>>>> 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 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]. >>>>>> 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] >>>>> 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 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]. >>>>> 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] >>>> 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 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]. >>>> 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] >>> 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. >>> >> >> >> >> -- >> 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 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]. >> 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] > 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 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]. > 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] 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.
