Sunday, 6 September 2015

Debugging Service Script using BPA script in OUAF Framework

Many a times in OUAF framework products, we have to create our own custom scripts. Since OUAF framework does do not offer an inbuilt testing/debugging option for scripts, we have to go through some round about way for achieving the same. Lets explore how to do the same for a service script.

Earlier had covered using XAI Inbound Service for testing a service script. This is another option using a BPA script to do the same, Using this you can test your service script for various input options and verify the output for each.

Lets take up a sample service script which takes two numbers as inputs and gives their sum back as output.

Below is the script schema:

Following is the script code. As seen it takes the two inputs sums it up and sets the sum in the output field.

Now lets create a BPA Script for testing the same. Go to Admin Menu => S => + Script



The script page opens up. Give a name to the script e.g. "CM-TestBPA" and in the script type select BPA Script Type. In Accessibility option select Accessible from Script Menu.

Go to the Data Area tab and add a row for the service script you wish to test. In our case it is CM-TestSS. Save the data entered so far.


After that go to the Step Tab and Enter steps as shown below.

Create User input prompts and get the required input data to pass to the service script. The number of inputs required will depend on the service script being tested.


Step 10: Prompt user to input First number and store the number entered in the first input element on of your service script data area.

Step 20: Prompt user to input Second number and store the number entered in the Second input element on of your service script data area.

After all inputs have been captured, invoke the service script that you want to test. Below image shows the configuration required for the same.


Finally retrieve and display the output of the service script.
After the service script is executed we would want to see the output values. For that used the display text step type and in the Text area would the Xpath of the value that you wish to see within the '%+' tags. In our case we want to view the output tag. So our text is %+CM-TestSS/output+%


Finally save the script.


Now to execute the bpa script. Do the following. On the application screen, click on Ctrl + Shift + S
The BPA script search screen opens up. Search for your BPA script using the description that you had entered.


On clicking on the BPA script in the search screen, the BPA script opens up in the BPA area.
As seen it is prompting the user to enter the first number.

Enter the first input, in this case '10' and click on Continue Button

Enter the second number '20' and click on Continue button

As seen below the service script is called and the output is displayed to the us. In this case the output of the script is 30 which is the sum of the two inputs.



Thus we have successfully tested a service script using a BPA script. So for testing any service script all you have to do is create the required number of input prompts as required for passing inputs to your service script. For output you can choose to pass the complete script Xpath in the display text section to see the entire data returned by the service script.

No comments:

Post a Comment

OUAF Oracle Utilities WAM / ODM 2.4.0.0 installation on Windows

  This blog is for anyone looking to install Oracle Utilities WAM or ODM 2.4.0.0 (Oracle Utilities Workflow and Asset Management) or (Orac...