|
Task Description: To test your application, you
often need large random data created in database. This example
demonstrates how to use random variables to generate test
data for testing.
See more Automated Testing examples
T10.atmn
Note: Save the .atmn file in My Documents->Automation
Anywhere->Automation Anywhere->My Tasks
|
Solution |
| 1. |
Record a new task. |
Record a task that enters a value
in one of the columns in your database for e.g.
Microsoft Access |
| 2. |
Create a random variable. |
Create a random variable using the
Tools->Variable Manager.
Screenshot 1 You
can generate two types of random values in Automation
Anywhere
- String - Specify the length of random
string you want to generate
- Numbers - Specify the lower and upper
range between which you want to generate random
numbers. For e.g. to generate random numbers
between 4 and 10 you would specify 4 in From
and 10 in To.
|
| 3. |
Populate seed data
in multiple columns |
Open the recorded task in Editor
and put a loop of 100 around the keystroke action
that enters the value in your database. Replace
the recorded keystroke action with a random variable
as shown in Screenshot
2 |
| |
| When
you run this task, it will enter 100 random values
in your table. You can change 100 to any other number
and enter thousands of rows for testing purposes
and save time creating those records in your database. |
|