Create a Transaction with Randomized Web Form Data

From WebWatchBotWiki
Jump to: navigation, search
 Share 

Summary

This article covers the topic of creating a Transaction that submits a web form with randomized field data each time it is run. This is useful for testing web forms that create user accounts or subscriptions.

Part 1: Record a Transaction

  1. In WebWatchBot Manager, select the menu options: File -> New -> Record a Transaction
  2. The Transaction Recorder window will open:
    transaction-recorder.gif
  3. For the purposes of this article, the following URL will be used to demonstrate the randomization functionality: http://www.exclamationsoft.com/webwatchbot/testing/transaction/login.html
  4. Enter the URL and press ENTER or click the button "Go"
  5. The login page will load
    login-page.gif
  6. Enter "username" in the username field
  7. Enter "password" in the password field
  8. Click the "Submit" button
  9. The entered data will appear on the subsequent page
    data-entered.gif
  10. Save the recorded Transaction by clicking "Save and Close" on the toolbar. This will save two steps for the Transaction.
  11. Click OK to save the Transaction
  12. The Transaction will appear in the Watch List with a Summary and 2 Transaction steps.

Part 2: Configure the Transaction for Random Data

  1. In the Watch List, select the second Transaction step. This step POSTs the form data to the web form.
  2. Right-click on the second Transaction step and select "Properties" from the menu
  3. The Watch Item Properties window will appear
  4. Click the "Settings" button
  5. The "HTTP Settings" window will appear
  6. Select the "Form" tab
    form-tab.gif
  7. Note the POST data that contains the following string username=username&password=password&submit2=Submit
  8. For this article, the username will be randomized with letters and numbers.
    1. Change the text "username" after the equal sign to (*TEXT:6*)(*INTEGER:2*).
    2. The new POST data should be: username=(*TEXT:6*)(*INTEGER:2*)&password=password&submit2=Submit.
    3. This will create a random username with 6 letters and 2 numbers.
  9. Click the OK button twice to close and save the Watch Item

Part 3: Test Results

  1. Select the Transaction's Summary in the Watch List
  2. On the toolbar, click the "Run Now" button
  3. Each step in the Transaction should have their action change from "Sleeping" to "Running".
  4. When the second Transaction step completes running, select the "Output" tab at the bottom of the WebWatchBot main window
  5. The browser output should show a different username
    output.gif
  6. Run the Transaction again to test for more randomized results
  7. Change the values of other form data, such as the password, to see other fields with randomized results.

More Information

  1. Form data randomization was introduced in version 5.0.3.
  2. Types of replacement tags available:
    1. (*TEXT:0*)
    2. (*DECIMAL:2.2*)
    3. (*INTEGER:0*)
    4. The number specified is the length of either the text string or the number
  3. Decimals can have a precision (digits after the decimal symbol) of up to 9.
  4. The maximum length of a decimal and integer is 20.