Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Use of RegisterUserFunc
#1
Not Solved
Hi Ankur,

I am trying to use RegisterUserFunc in my script to set one Function and Use it as my new Value.

What I want to do is I have Textbox of name:"ClientName". Everytime when I run my script I want to use a new value for that I created one function of Random_Generator which generates Random No and then Join this Random No with one predefined clientName:

here is that Function:

Code:
Function Random_Generator (Max_Value, Min_Value)
   Dim Mystring,MyValue,MyArray(1),RandomNo
   Max_Value=100
   Min_Value=10
   Randomize
   RandomNo=Int ((Max_Value - Min_Value + 1) * Rnd) + Min_Value
   Mystring = Cstr (RandomNo)
   MyArray(0) = "Smoke Test_AddClient"
   MyArray(1) = Mystring
   MyValue = Join (MyArray)
   MyValue= Cstr(MyValue)
   Random_Generator=MyValue
'   msgbox Random_Generator
End Function

after this I am going to the main Test, and recording a script, right now I am trying on Google. Our environement is not ready for testing.

I recorded the script for logging in Google.

and then I used this function so I can enter different username each time i run the script,
Code:
'RegisterUserFunc  "WebEdit", "Set", "Random_Generator"
Browser("Gmail: Email from Google").Page("Gmail: Email from Google").WebEdit("Email").Set " "

here i donot unserstand what should I put in Set " " field. I tried to put lot of things but it is not inserting any text in gmail username.

Do i need to change anything in the object proporties first.

Thanks
Tapan Dalal
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)