52
ANY QUESTIONS?? Introduction to SOAPUI 1

Soap UI - Lesson3

Embed Size (px)

DESCRIPTION

Lesson 3 http://www.qualitestgroup.com/

Citation preview

Page 1: Soap UI - Lesson3

ANY QUESTIONS??

Introduction to SOAPUI

1

Page 2: Soap UI - Lesson3

WORKING WITH TEST STEPS

Introduction to SOAPUI

2

Page 3: Soap UI - Lesson3

Protocol Oriented Test Steps

• SOAP request

• REST request

• JDBC Request

3

Page 4: Soap UI - Lesson3

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: Soap UI - Lesson3

Flow Control-oriented Test Steps

• Properties

• Delay

• Groovy script intro

• Manual

• GoTo

5

Page 6: Soap UI - Lesson3

Properties

6

Page 7: Soap UI - Lesson3

Transfer Properties

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

7

Page 8: Soap UI - Lesson3

Transfers Dialog

8

Page 9: Soap UI - Lesson3

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: Soap UI - Lesson3

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: Soap UI - Lesson3

Delay

11

Page 12: Soap UI - Lesson3

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: Soap UI - Lesson3

Manual Test Step

13

Page 14: Soap UI - Lesson3

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: Soap UI - Lesson3

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: Soap UI - Lesson3

Go To

16

Page 17: Soap UI - Lesson3

GoTo XPath

17

Page 18: Soap UI - Lesson3

Data-Oriented Test Steps

• Data Source

• Data Source Loop

• Data Sink

• Data Gen

18

Page 19: Soap UI - Lesson3

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: Soap UI - Lesson3

Setting up Data Sync

20

Page 21: Soap UI - Lesson3

Sample Template File

• Data Input file with new header for actual results

21

Page 22: Soap UI - Lesson3

Create File

• If Excel needs to be .xls

22

Page 23: Soap UI - Lesson3

Create Property for Actual Value

23

Page 24: Soap UI - Lesson3

Select Element

24

Verify test step order

Page 25: Soap UI - Lesson3

After Running

25

Page 26: Soap UI - Lesson3

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: Soap UI - Lesson3

Data Gen

27

Page 28: Soap UI - Lesson3

DataGen Script for Today’s Date

28

${DataGen#today}

Page 29: Soap UI - Lesson3

Template DataGen

29

Page 30: Soap UI - Lesson3

Number DataGen

30

Page 31: Soap UI - Lesson3

List DataGen

31

Page 32: Soap UI - Lesson3

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: Soap UI - Lesson3

Set up REST project

• Can create a REST project by

– Using URI

– Importing WADL

– Discover REST services

33

Page 34: Soap UI - Lesson3

REST – URI Address

34

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

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

Page 35: Soap UI - Lesson3

Project is Set up

35

Can create multiple resources at this level

Page 36: Soap UI - Lesson3

Request Tab

36

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

Page 37: Soap UI - Lesson3

Parameter Types

37

• QUERY

• TEMPLATE

• HEADER

• MATRIX

• PLAIN

Page 38: Soap UI - Lesson3

Resource or Method Level

38

Page 39: Soap UI - Lesson3

QUERY

39

Page 40: Soap UI - Lesson3

HEADER

40

Page 41: Soap UI - Lesson3

TEMPLATE

41

Page 42: Soap UI - Lesson3

MATRIX

42

Page 43: Soap UI - Lesson3

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: Soap UI - Lesson3

REST Uses Path for Resource Names

44

Page 45: Soap UI - Lesson3

SOAP/REST

• Project

– Service• Resource

– Method

45

• Project

– Interface• Operation

– Request

Page 46: Soap UI - Lesson3

Note the Method Options

46

Page 47: Soap UI - Lesson3

Submit the Request

47

Page 48: Soap UI - Lesson3

Optional parameters

48

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

Page 49: Soap UI - Lesson3

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: Soap UI - Lesson3

Discover REST APIs

50

1

2

3

Page 51: Soap UI - Lesson3

Discover REST API (cnt)

51

4

5

6

Page 52: Soap UI - Lesson3

Discover REST (cnt 2)

52