introduction to soapui day 3

54
ANY QUESTIONS?? Introduction to SOAPUI 1

Upload: qualitest-group

Post on 03-Jul-2015

355 views

Category:

Technology


4 download

DESCRIPTION

A method of communicating between two devices A software function provided at a network address over the web with the service always on It has an interface described in a machine-processable format http://www.qualitestgroup.com/

TRANSCRIPT

Page 1: Introduction to SoapUI day 3

ANY QUESTIONS??

Introduction to SOAPUI

1

Page 2: Introduction to SoapUI day 3

WORKING WITH TEST STEPS

Introduction to SOAPUI

2

Page 3: Introduction to SoapUI day 3

Protocol Oriented Test Steps

• SOAP request

• REST request

• JDBC Request

3

Page 4: Introduction to SoapUI day 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

Page 5: Introduction to SoapUI day 3

Flow Control-oriented Test Steps

• Properties

• Delay

• Groovy script intro

• Manual

• GoTo

5

Page 6: Introduction to SoapUI day 3

Properties

6

Page 7: Introduction to SoapUI day 3

Transfer Properties

• Once properties are created, use a transfer properties test step to pass on the information

7

Page 8: Introduction to SoapUI day 3

Transfers Dialog

8

Page 9: Introduction to SoapUI day 3

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

Page 10: Introduction to SoapUI day 3

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

Page 11: Introduction to SoapUI day 3

Delay

11

Page 12: Introduction to SoapUI day 3

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

Page 13: Introduction to SoapUI day 3

Manual Test Step

13

Page 14: Introduction to SoapUI day 3

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

Page 15: Introduction to SoapUI day 3

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

Page 16: Introduction to SoapUI day 3

Go To

16

Page 17: Introduction to SoapUI day 3

GoTo XPath

17

Page 18: Introduction to SoapUI day 3

Data-Oriented Test Steps

• Data Source

• Data Source Loop

• Data Sink

• Data Gen

18

Page 19: Introduction to SoapUI day 3

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

Page 20: Introduction to SoapUI day 3

Setting up Data Sync

20

Page 21: Introduction to SoapUI day 3

Sample Template File

• Data Input file with new header for actual results

21

Page 22: Introduction to SoapUI day 3

Create File

• If Excel needs to be .xls

22

Page 23: Introduction to SoapUI day 3

Create Property for Actual Value

23

Page 24: Introduction to SoapUI day 3

Select Element

24

Verify test step order

Page 25: Introduction to SoapUI day 3

After Running

25

Page 26: Introduction to SoapUI day 3

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

Page 27: Introduction to SoapUI day 3

Data Gen

27

Page 28: Introduction to SoapUI day 3

DataGen Script for Today’s Date

28

${DataGen#today}

Page 29: Introduction to SoapUI day 3

Template DataGen

29

Page 30: Introduction to SoapUI day 3

Number DataGen

30

Page 31: Introduction to SoapUI day 3

List DataGen

31

Page 32: Introduction to SoapUI day 3

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

Page 33: Introduction to SoapUI day 3

Set up REST project

• Can create a REST project by

– Using URI

– Importing WADL

– Discover REST services

33

Page 34: Introduction to SoapUI day 3

REST – URI Address

34

http://maps.googleapis.com/maps/api/geocode/xml?address=1600+Amphit

heatre+Parkway,+Mountain+View,+CA&sensor=false

Page 35: Introduction to SoapUI day 3

Project is Set up

35

Can create multiple resources at this level

Page 36: Introduction to SoapUI day 3

Request Tab

36

• Includes the fields – you could put in additional fields in this form as well

Page 37: Introduction to SoapUI day 3

Parameter Types

37

• QUERY

• TEMPLATE

• HEADER

• MATRIX

• PLAIN

Page 38: Introduction to SoapUI day 3

Resource or Method Level

38

Page 39: Introduction to SoapUI day 3

QUERY

39

Page 40: Introduction to SoapUI day 3

HEADER

40

Page 41: Introduction to SoapUI day 3

TEMPLATE

41

Page 42: Introduction to SoapUI day 3

MATRIX

42

Page 43: Introduction to SoapUI day 3

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

Page 44: Introduction to SoapUI day 3

REST Uses Path for Resource Names

44

Page 45: Introduction to SoapUI day 3

SOAP/REST

• Project

– Service• Resource

– Method

45

• Project

– Interface• Operation

– Request

Page 46: Introduction to SoapUI day 3

Note the Method Options

46

Page 47: Introduction to SoapUI day 3

Submit the Request

47

Page 48: Introduction to SoapUI day 3

Optional parameters

48

• https://spreadsheets.google.com/pub?key=p9pdwsai2hDMsLkXsoM05KQ&gid=1

Page 49: Introduction to SoapUI day 3

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

Page 50: Introduction to SoapUI day 3

Discover REST APIs

50

1

2

3

Page 51: Introduction to SoapUI day 3

Discover REST API (cnt)

51

4

5

6

Page 52: Introduction to SoapUI day 3

Discover REST (cnt 2)

52

Page 53: Introduction to SoapUI day 3

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

Page 54: Introduction to SoapUI day 3

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