Testing Web Services with OpenScript 9.10

In this tutorial you will be using the samples applications that come bundled with weblogic to generate and validate a web services script using OpenScript, the tutorial assumes that you have already installed Oracle Application Test Suite.

Running the sample application

To run the tests we will first need to run the sample application, start it by:
Start -> All Programs -> Oracle Application Testing Suite -> Oracle WebLogic -> Weblogic Server 11gR1 -> Examples -> Start Examples Server.

Wait for the browser to open, then click on Code Examples and Sample Applications

b6s1.JPG

Look for the Java Web Service Metadata Annotations, and click on Run the example

b6s2.JPG

To understand what this simple object test does, enter a name in text box and click on submit query

b6s3.JPG

If everything is working as expected we will receive the following response:

b6s4.JPG

Creating the web services script

We will now create the web services script as we created the web functional script, however this time we will select Web Services under General.
File -> New -> General -> Web Services -> select the samples workspace -> name it sayHelloWS -> Finish

b6s5.JPG

Parsing the WSDL
In OpenScript make sure that the WSDL Manager tab is selected and click on the Add icon

b6s6.JPG

In the parse WSDL window enter the WSDL url and live the others as default.
http://localhost:7001/jws_basic_simple/SimpleService?WSDL

b6s7.JPG

Click Next to parse the WSDL.
Once finished you will be able to see the methods found in the WSDL file.

b6s8.JPG

Click Finish to apply the changes.

Adding the methods to the script.
Next drag the sayHello method from the WSDL manager to the run section of your script

b6s9.JPG

The script should look like this:

b6s10.JPG

Add in the Databank values.

Next we will build a new databank with different names to be used as parameters for our web service:
New -> Script Asset ->Databank -> Next -> select the Samples workspace -> name it msg -> Finish

Edit the file with the following values:
msg
Basil Fawlty
Sybil Fawlty
Polly Sherman
Manuel
Major Gowen
Terry
Miss Gatsby and Miss Tibbs

Next open the sayHello method until you find the XML Post, click on it to see the XML in the details pane, make sure that XML is selected (not XML tree) and highlight the word string, right click and select Substitute Variable

b6s11.JPG

Select Add New Databank, select the msg.csv file click Next to view the data and click Finish to apply the changes.

The syntax in the XML file should now look like this:

b6s12.JPG

Running the Script

Click the Playback icon to execute the test once (OpenScript will use the first value of your databank), once the script has executed select the URL under sayHello in the Results pane and select XML from the details pane, the return message should now say: Here is the message: 'Basil Fawlty'

b6s13.JPG

Validating the Script

To validate the script we will add a text matching test, to make sure that we get the correct message back.

Highlight the Here is the message: 'Basil Fawlty' text right click and select Add Text Matching Test, set the name filed to message, as we are using a databank and the value of Basil Fawlty will be dynamic we now need to databank that value in the text matching test so it uses the same value that we are posting, as we only want to databank the Basil Fawlty. highlight the text and click on the Substitute Variable icon:

b6s14.JPG

Select the variable msg from the tree, and click Finish .
Note that only the text Basil Fawlty has been substituted by a variable:
Here is the message: '{{db.msg.msg,Basil Fawlty}}'

Click OK to apply the changes.

Iterating the script

Next we will iterate the script with the different values from the databank.
Click on the iterate icon to start the test, select Iterate until all records are used and click OK.
Once the test is finished look at the results report and note how the data matches the different tests.

b6s15.JPG

Comments:

I'm looking for a manual that starts with the basics, e.g., installing OATS, preparing web scripts, then how to analyze the source code. I'm glad to have found, Testing Web Services with OpenScript 9.10 By Alex on July 16, 2010 8:30 AM, but I need more assistance.

Posted by Janet Deutsch on August 05, 2010 at 08:09 AM BST #

Dear Alex, thanks for your tutorial about web services testing. I just tried it with the most recent Release 9.20 of Oracle Application Testing Suite (COMPLETE not the minimal install). It contains the full Web Logic Server and examples with the default install location at C:\OracleATS\wls\wlserver\samples\. However the link in the Start Menu is not installed by default, I had to manually start it by executing C:\OracleATS\wls\wlserver\samples\domains\wl_server\bin\startWebLogic.cmd Then my browser opened http://localhost:7001/examplesWebApp/index.jsp which contains the examples you described. Perfect, this made my day! Kind regards, Stefan

Posted by Stefan Thieme on March 21, 2011 at 05:44 AM GMT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

bocadmin_ww

Search

Archives
« July 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
  
       
Today