Created By  inflectra.adam Tuesday, June 26, 2018

You have recorded some basic test scripts in Rapise, and now you want to easily extract the steps into a reusable function that can be called from the main test script. This article explains how you can do this for both RVL and JavaScript based tests.

Create User Function from RVL

If you have a record Rapise Visual Language (RVL) script:

To convert this to a User Function, simply select the rows, and choose Copy Selection as JavaScript:

Now you can open up the MyTest.user.js file and create a new function definition. Then paste the copied JavaScript inside:

You can then call this function from within your RVL test script:

Create User Function from JS

When you are using JavaScript as your scripting language, there is an option to create a new function/scenario directly from your code.

For example, in a sample recorded test:

Now, select the rows you want to include in the function/scenario and then choose Extract User Scenario:

Give the new scenario a name:

Rapise will now extract the test steps into a new test scenario, and automatically add the code to invoke the scenario, to the main test function:

Attachments

Selected files will be attached to any email sent on saving ticket.

file selected files selected  () Delete Selected

  • Created:
  • by:

Select files to upload

Or drag and drop files here

Uploading …
Done!
Upload More?
There was an error.
Try again?

Save to upload the selected file(s)

Article Info
  • Last Updated: 6/26/2018
  • Article ID: KB352
  • Views: 339