Page 1 of 1

Simple Variable Random Code

Posted: Mon Jun 29, 2015 4:37 pm
by kieranwood
Hi there,

I would like to add a random number to the input of a test case I am attempting to run.

I would like it so it outputs a random number from a selection. i.e. test88

Is there a simple way of doing this in the code?

Thanks

Re: Simple Variable Random Code

Posted: Mon Jun 29, 2015 7:22 pm
by afleitas
Hello There,

If I were you I would look into the Random() class.

http://stackoverflow.com/questions/1353 ... rator-work

Please see example below that just creates a messagebox that has a Ran number in it. You can change this and implement however you would like.

Re: Simple Variable Random Code

Posted: Tue Jun 30, 2015 8:27 am
by kieranwood
Hi there,

Thanks for that. After some playing I was able ot understand how to implement this weithin a test case step.

Kind regards