In this section:

Recording API Traffic

  1. If not already running, start the SOAtest Web Proxy. See Starting the Web Proxy.
  2. Navigate to the web application you want to generate tests from and click the Parasoft icon.
  3. Enable the API Traffic for Parasoft SOAtest option and click Start Recording. You can record UI actions and API traffic simultaneously by enabling both the API Traffic for Parasoft SOAtest and UI Actions for Parasoft Selenic options. The application type setting does not impact API traffic recording. 
  4. Perform your test scenario.
  5. When finished, click the logo and choose Stop Recording.
  6. If you configured Parasoft Recorder to capture UI actions while exercising your API test scenario, you will be prompted to save them first. See Recording UI Actions
  7. Specify information for the test when prompted. Test names must be unique. You can also associate tests with artifacts in your requirements and/or defect tracking system. 
  8. Click Create Test Asset when ready or Discard Recording to exit the test creation window without generating the test file.
  9. When the Parasoft Recorder finishes processing the recorded traffic, you will be prompted to view the test in the CTP API Testing module. SOAtest will process the traffic using internal heuristics, as well as any matching rules in the smart test templates (.stt), to generate the test. Refer to Configuring Smart API Test Generation for additional information.
     
  10. The test will appear under the TestAssets/users/<username> directory, where the /users/<username> sub-directory is created based on your CTP username.

    You can also view the test in the SOAtest desktop Test Case Explorer.
     
    If you are using the Parasoft Recorder with a local instance of SOAtest, your tests will appear in the TestAssets/users/anonymous directory.

A recorded_traffic folder will be created in the SOAtest server workspace next to the .tst file and a traffic file will be uploaded to the folder. You can use the recorded traffic file to create new tests using the smart test traffic wizard (see Creating Smart API Tests from Traffic), as well as to train the Smart Test Generator (see Configuring Smart API Test Generation).The Resultant Set of Policy tool will show which policy setting Windows is using.  A Windows domain administrator within the organization will need to change the policy.

Troubleshooting

Chrome does not allow the extension to change proxy settings

If you are using Windows and get an error stating "Chrome does not allow the extension to change proxy settings" when attempting to record API traffic with Chrome, you can fix the issue by disabling the group policy "Choose how to specify proxy server settings" under Administrative Templates > Google > Google Chrome > Proxy server. When the policy is enabled, it blocks the Chrome extension from changing the proxy. This issue does not affect Linux or Mac users.

To change the group policy:

  1. Open a command prompt with administrator privileges and run rsop. The Resultant Set of Policy window opens.
  2. In the Resultant Set of Policy, check Computer Configuration > Administrative Templates > Google > Google Chrome > Proxy Server to see if the policy "Choose how to specify proxy server settings" is enabled. If so, a Windows domain administrator within your organization will need to disable it.
  3. Once the policy has been changed, open a command prompt again and run gpupdate /force.
  4. Run rsop again to confirm the policy has been disabled.

If that doesn't work, you can try to manually disable the policy in the registry:

  1. Open a command prompt and run regedit. The registry editor opens.
  2. Locate the HKEY_LOCAL_MACHINE or HKEY_CURRENT_USER > Software > Policies > Google > Chrome folder.
  3. Delete the ProxyMode key and reboot your machine.
  4. Check the registry to make sure the key was not regenerated.

Recording UI Actions

  1. Navigate to the web application you want to generate tests from and click the Parasoft icon.
  2. Enable the UI Actions for Parasoft Selenic option and choose either General, Salesforce, or Guidewire for the application type. Specifying the application type optimizes the locator strategy for the specific application. Choose General if your application is not a Salesforce or Guidewire application. You can also record UI actions and API traffic simultaneously by enabling both the UI Actions for Parasoft Selenic and API Traffic for Parasoft SOAtest and options.  
  3. Click Start Recording and perform your test scenario.
  4. When finished, click the logo and choose Stop Recording.
  5. Specify information about the actions your captured when prompted. By default, the application domain and a time stamp indicating when recording began are used for the test name. Descriptions help other users understand the user experience the test is intended to verify. You can also associate tests with artifacts in your requirements and/or defect tracking system. All of the test information will be added as Javadoc comment when the file is used to generate a Selenium test in Selenic. 
  6. Click Continue and save the file. 
  7. If you configured Parasoft Recorder to API traffic while performing your UI tests, you will be prompted to save the API tests after saving the UI actions. See Recording API Traffic

You can import the recorded UI actions into and IDE with the Selenic plug-in enabled to create Selenium tests. See Parasoft Selenic for details on next steps.

Asserting Element Text

You can record assertions on text in UI elements as you record actions. The assertions are added to Selenium tests created in Parasoft Selenic. Refer to the Selenic documentation for details.

  1. Start a UI test session and click the Parasoft icon to open the Parasoft Recorder actions.
  2. Click Assert Text to enter assertion mode.
  3. The pointer will change into crosshairs and elements that you hover the crosshairs over will be outlined.
  4. Click on the element to capture the assertion.
  5. Click Confirm in the Assert Text dialog to accept the asserted value. You can also make modifications to the text in the Value field. The locator selected for the assertion appears in the Locator field. You can also click Cancel to exit assertion mode without asserting the text.
     
  6. Complete your test session and download the recording as described in Recording UI Actions.

Refer to the Selenic documentation for information about assertions in UI tests.


  • No labels