Pass dynamic variable on each run of test

Ask general questions here.
Balajirbala
Posts: 1
Joined: Wed Jul 24, 2019 8:14 am

Pass dynamic variable on each run of test

Post by Balajirbala » Wed Jul 24, 2019 8:18 am

Hi,

I am working in an Insurance application where I need to create a case each time with unique claim number. Is there any option in Ranorex to perform this ?

Thanks!

User avatar
Vega
Posts: 161
Joined: Mon Jul 11, 2016 2:15 pm

Re: Pass dynamic variable on each run of test

Post by Vega » Fri Jul 26, 2019 9:49 pm

If you use Ranorex Automation helpers within your solution, you can use the user code method 'GetRandomString(String length)'. There is no way to guarantee it is unique in your system; however the longer the string is, the more likely it is to be unique. Here I chose to generate a random string with 100 characters and output it to the report:
f1.png
f1.png (18.13 KiB) Viewed 58 times
Alternatively if you want more control, you can also just use .NET code to generate a random string/number/etc:

https://www.dotnetperls.com/random

Hope this helps