ANY QUESTIONS??
Introduction to SOAPUI
1
WORKING WITH TEST STEPS
Introduction to SOAPUI
2
Protocol Oriented Test Steps
• SOAP request
• REST request
• JDBC Request
3
Protocol Test Steps
• All of the requests within a Test Suite have to come from the same project
• Requests from different protocols can be loaded into the same project
4
Flow Control-oriented Test Steps
• Properties
• Delay
• Groovy script intro
• Manual
• GoTo
5
Properties
6
Transfer Properties
• Once properties are created, use a transfer properties test step to pass on the information
7
Transfers Dialog
8
Transfer to hand off session id• This property transfer is set up to hand off the
sessionid from the login response to the logout request
•
9
Exercise
• It would be nice to have the application id from the GetAllBibDataInfo request to pass on to the GetApplicationInfo request so let’s add in the application id as a transfer property and add it as another test step in the test case between GetAllBibDataInfo and GetApplicationInfo.
• Then add an assertion on the GetApplication info request to make sure that it is also working correctly. Since Patent Number is one of the fields in the response for the GetApplicationInfo, add an assertion that this matches the original Patent Number input
10
Delay
11
Exercise – Delay Step
• Add in a Delay Step in the previous exercise before the Property Transfer step – this will allow time for the response from GetAllBibDataInfo to be completed before transferring the data to GetApplicantInfo is executed.
12
Manual Test Step
13
Executing w/ a Manual Step
• If you have any manual test steps in your test case/test suite, you will get a dialog pop-up that provides instructions and requests information before moving on to the next test step
14
Exercise – Manual Step• Add a manual step in the previous exercise before
the DataSource Loop with the following actions and expected outcome:
• Action: Get up from your chair and walk one time clockwise around the conference table, returning to your seat.
• Expected outcome: You feel refreshed and ready to take on more challenging exercises.
• Run your test suite, recording the actual results and Pass/Fail status for the manual step
15
Go To
16
GoTo XPath
17
Data-Oriented Test Steps
• Data Source
• Data Source Loop
• Data Sink
• Data Gen
18
Data Sink
• Allows you to parse values from your test and write them to output file
• If you want to use some of the data in the response of a request, start with a valid executed response
19
Setting up Data Sync
20
Sample Template File
• Data Input file with new header for actual results
21
Create File
• If Excel needs to be .xls
22
Create Property for Actual Value
23
Select Element
24
Verify test step order
After Running
25
Data Sink Exercise
• Using the currency conversion project and the previous steps, add a Data Sink to capture the actual results in your test suite
26
Data Gen
27
DataGen Script for Today’s Date
28
${DataGen#today}
Template DataGen
29
Number DataGen
30
List DataGen
31
Mode & Shared
• Mode
– READ pulls a new value every time it is referenced
– STEP pulls a new value every time DataGen is called
– Call DataGen prior to use as in the initial state, the property has no value
• Shared
– For use in load tests – value can be shared across multiple threads
32
Set up REST project
• Can create a REST project by
– Using URI
– Importing WADL
– Discover REST services
33
REST – URI Address
34
http://maps.googleapis.com/maps/api/geocode/xml?address=1600+Amphit
heatre+Parkway,+Mountain+View,+CA&sensor=false
Project is Set up
35
Can create multiple resources at this level
Request Tab
36
• Includes the fields – you could put in additional fields in this form as well
Parameter Types
37
• QUERY
• TEMPLATE
• HEADER
• MATRIX
• PLAIN
Resource or Method Level
38
QUERY
39
HEADER
40
TEMPLATE
41
MATRIX
42
Exercise
• Building the correct URI
• Create a separate REST project for each of the following URIs and adjust the parameters as needed to build the correct URI:
• http://www.thomas-bayer.com/sqlrest/CUSTOMER/18/ (remember that any number can be used after CUSTOMER)
• http://fqt-tmng-cms.etc.uspto.gov/trademark/cms/rest/metadata/cases/id;sn=76705762
43
REST Uses Path for Resource Names
44
SOAP/REST
• Project
– Service• Resource
– Method
45
• Project
– Interface• Operation
– Request
Note the Method Options
46
Submit the Request
47
Optional parameters
48
• https://spreadsheets.google.com/pub?key=p9pdwsai2hDMsLkXsoM05KQ&gid=1
Exercise • Create new project using REST service -
https://maps.googleapis.com/maps/api/geocode/xml?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&sensor=false
– Change xml > json for different format in response
• Create multiple requests with different optional input parameters and different output formats
– Input parameters: language (see previous sheet), region (2 char country code that would be used in url such as ca, gb, gr, jp, etc.)
49
Discover REST APIs
50
1
2
3
Discover REST API (cnt)
51
4
5
6
Discover REST (cnt 2)
52
Exercise • Create new project using Discover REST
service –from http://tmog.uspto.gov/
• 1) before loading the page, turn off the discovery recording
• 2) load the url and then set up a search based on other parameters (such as serial number)
• 3) turn on the discovery recording
• 4) submit the request and filter the response content types
• 5) generate service53
Exercise
• Using the Javadoc for TMNG_CMS, build the resources and methods for
• Retrieval of Mark
• Retrieval of Image-png
• Content Retrieval for the Mark Image
• Setup test cases to test a valid request using a data source for input and a datasync to capture the outputs
54