Forum Discussion

sonya_m's avatar
sonya_m
Icon for Alumni rankAlumni
5 years ago
Solved

[TechCorner Challenge #9] Generate a random number within a range

Hi Community!

 

Another awesome task is readyπŸ™‚

 

By completing the task, you will not only learn TestComplete features but also get into the TechCorner Leaderboard.

 

Participate in the challenge and earn new unique badges! Check out some of these awesome rewards:

 

Let's imagine that you are testing an application that has gaming elements - a knight is using a legendary sword to slay a dragon! And, the sword will deliver damage in the following range - from 30 to 75. 

 

Instead of using the same number every time, you want to generate a random number on each run and enter it in the application. How would you do it in TestComplete?


Let's see if we can get an example for each scripting language (JavaScript, JScript, Python, VBScript)! 

Task: Generate a random number within the following range (30-75) in TestComplete using a scripting language of your choice. 

Difficulty:

 

Bonus: You will get an additional point for each script written in a different language.

 

Best of luck!