How to Generate a random value (string/date/number) in ATF shared paramter?

Laloo1
Kilo Contributor

How to Generate a random value (string/date/number) in ATF?

E.g: I have set type of parameter as Script.

find_real_file.png

In the Script i have mentioned the below.

find_real_file.png

But not sure how to output this, so i can use it in the Test step.

1 ACCEPTED SOLUTION

Hi Laloo

Strange, we are using it. For "Run Server Side Script" you can use outputs.record_id. It accepts maximum length of 32. 

--
Best Regards
Ankush

P.S. Please mark helpful/correct as appropriate to help the fellow community member in identifying the relevant answers.

View solution in original post

5 REPLIES 5

Ankush Agrawal
ServiceNow Employee
ServiceNow Employee

Hi

You can try creating a parameter type of String and give the values as the below:

javascript:gs.nowDateTime()

--
Best Regards
Ankush

P.S. Please mark helpful/correct as appropriate to help the fellow community member in identifying the relevant answers.

Hello Ankush,

Thanks for the reply.

There is no value field on the parameter page. I tried passing this in test run data but this doesn't print's time, the same is copied as it is in results.

find_real_file.png

I am sorry for the typo, corrected the answer.

Thanks Ankush for a quick reply, unfortunately this is also not working.

find_real_file.png

Is there a way were we can pass a string value from step "run server side script" to another step? may be that will help.

 

Thanks & Regards,

Laloo Thadhani