views:

37

answers:

1

Just using selenium to fill out some forms for me. I need it to generate a unique value for my username field. How can I do that?

I've got

Command: type
Target: id_of_my_field
Value: username+unique_value ???

+2  A: 

You can use javascript to do that:

Value: javascript{'username'+Math.floor(Math.random()*100000)}

This will append a 6 digit random number to your username.

See this SO question and answers for more details and other ways to do this...

Ryley
Darn it. I was trying `javascript:`. Didn't know about the `{}` syntax. Thanks!
Mark