soapui notes

284
Before we strt testing with sopui, follow step by step procedure mentioned below to instll sop ui bet (version 4.5.1) in your mchine. Before strting to instll SOP UI bet you cn downlod the setup (.exe) file from the link – SOPUI Step 1: Click on sopUI-x32-4.5.1.exe (32 bit windows instller) vilble in your locl computer. This will strt the Sopui instller s shown below. Step 2: fter the bove instller progress completes you will see the Smrtber Setup wizrd. Click on Next.

Upload: sai-krishna

Post on 21-Jan-2016

112 views

Category:

Documents


3 download

DESCRIPTION

soapui notes

TRANSCRIPT

Page 1: Soapui Notes

Before we strt testing with sopui, follow step by step procedure mentioned below to instll sop ui bet (version 4.5.1) in your mchine.

Before strting to instll SOP UI bet you cn downlod the setup (.exe) file from the link – SOPUI

Step 1: Click on sopUI-x32-4.5.1.exe (32 bit windows instller) vilble in your locl computer. This will strt the Sopui instller s shown below.

Step 2: fter the bove instller progress completes you will see the Smrtber Setup wizrd. Click on Next.

Page 2: Soapui Notes

Step 3: License greement window is displyed. Click on ��I ccept the greement �� nd click on Next.

Page 3: Soapui Notes

Step 4: In this window, choose the destintion directory for sopui 4.5.1 to be instlled in your locl computer.

Page 4: Soapui Notes

Step 5: Select components window displys vrious components vilble for Sopui. Just click on Next.

Page 5: Soapui Notes

Note: Uncheck Hermes JMS component since instller would sk for jr file.

Step 6: The window shown in below figure llows downloding LodUI if u check the box.

Page 6: Soapui Notes

Note: If you don ��t wnt to setup LodUI, skip the below steps nd continue from Step 7.

Check the box to instll lodui in your setup wizrd nd click on Next.

Page 7: Soapui Notes

Now the window sks for proxy if it is vilble in your system. If you hve proxy, provide the proxy nd the port detils. Otherwise click on Next.

Page 8: Soapui Notes

Clicking on Next displys the License greement for LodUI.

Page 9: Soapui Notes

Step 7: Choose the trget loction for SOPUI tutorils using browse button.

Page 10: Soapui Notes

Step 8: Click on Next in the consecutive screens shown below.

Page 11: Soapui Notes

Step 9: Check the option crete desktop icon s in the imge to crete shortcut for SOPUI on desktop.

Page 13: Soapui Notes

Note: If you get the below error while Instlltion, ��error setting jxbrowser instll dir ��, downlod the .exe file gin nd instll it gin.

Page 15: Soapui Notes

Step 10: Click on Finish to complete instlltion

Page 18: Soapui Notes

Now tht we hve setup the environment for testing in Sopui in the previous tutoril, let ��s see how to crete project in this tutoril to do vrious types of testing like functionl testing, lod testing, security testing, etc.,

Before we strt creting new project in sopui 4.5.1, you need to know some of the importnt terms.

SOP is simple XML-bsed protocol to let pplictions exchnge informtion over HTTP. Or more simply: SOP is protocol for ccessing Web Service.

Why SOP??

It is importnt for ppliction development to llow Internet communiction between progrms. Tody’s pplictions communicte using Remote Procedure Clls (RPC) between objects like DCOM nd CORB, but HTTP ws not designed for this. RPC represents comptibility nd security problem; firewlls nd proxy servers will normlly block this kind of trffic. better wy to communicte between pplictions is over HTTP, becuse HTTP is supported by ll Internet browsers nd servers. SOP ws creted to ccomplish this. SOP provides wy to communicte between pplictions running on different operting systems, with different technologies nd progrmming lnguges.

Page 19: Soapui Notes

WSDL: WSDL stnds for Web Services Description Lnguge. It is written in XML. So we cn sy, WSDL is n XML document. WSDL is used to describe Web services. It is lso used to locte Web services. It is W3C recommendtion nd specifies the loction of the service nd the opertions (or methods) the service exposes.

W3C Recommendtion: W3C Recommendtion is the finl stge of rtifiction process of the World Wide Web Consortium (W3C) working group concerning technicl stndrd. This designtion signifies tht document hs been subjected to public review, hs circulted mongst W3C member orgniztions for review, hs tken ccount of feedbck on how implementble the document is nd tht it hs finished these processes. t this stge, the document hs been formlly pproved by W3C’s director preventing ny further technicl chnges nd mking it redy for wide deployment in its problem domin. The purpose of the recommendtion is to stndrdise the Web technology. It is the equivlent of published technicl stndrd in mny other industries.

With the knowledge of wht is WSDL nd wht is SOP, let ��s see how to crete project now in SOP UI step by step.

Step 1: Click on sopUI 4.5.1.exe, this will open the SOPUI s shown.

Page 22: Soapui Notes

The window nd its pnes re described in imge s shown below.

Page 24: Soapui Notes

Step 3: To crete new project, Click on File à New SOPUI Project.

Step 4: New SOPUI project is displyed s shown in figure. This llows the user to select vrious options while creting project.

Page 25: Soapui Notes

Step 5: In the bove window just give the project nme nd provide the wsdl url or wsdl file loction by clicking on Browse nd click on OK s shown in the imge below.

For smple testing, use the wsdl url provided,

http://www.mobilefish.com/services/web_service/countries.php?wsdl

Page 26: Soapui Notes

Step 6: Clicking on OK, will disply the progress of loding definition s shown below.

Step 7: Thus the sopui project is creted successfully s shown in the imge below.

Page 28: Soapui Notes

So fr, we hve seen how to crete project in sopui. Now in this tutoril, let ��s see how to run request vilble in project.

In order to run project, crete project s explined the previous tutorils. Follow the below steps to run project in SOPUI.

Step 1: Click on Request nme. This will disply the defult requests s shown in the imge below.

Page 29: Soapui Notes

Step 2: In the request, fill the vlue for the tgs with ��?��.

Page 30: Soapui Notes

Step 3: Check for the service endpoint before clicking in Run button.

Step 4: Click on Run button s shown in the below imge.

fter clicking on RUN,

Page 31: Soapui Notes

Step 5: Now you cn find the response for the bove requests in the Response window.

Page 32: Soapui Notes

Thus the response for the sop request is obtined s shown in the bove imge. Thus sopui project is run successfully.

Seting Up Preferences in your SOPUI

In this tutoril, let ��s see how to setup preferences nd sve your preferences vilble in SOPUI open source version nd Pro version.

Step by step explntion of ll the preferences is explined below.

Step 1: To go to Preferences window, click on File à Preferences or you cn just press Ctrl+lt+P key s shown in the imge below.

Page 33: Soapui Notes

Step 2: This will open the SOPUI Preferences window s shown below.

SOPUI Opensource version:

Page 35: Soapui Notes

SOPUI Pro version:

Page 37: Soapui Notes

Some of the tbs in both SOPUI open source nd Pro versions re common. The tbs in preferences window re explined below.

1. HTTP Settings tb:

Set properties specific to HTTP protocol (protocol version, User-gent heder, request nd response compression etc.).

Page 38: Soapui Notes

Option DescriptionHTTP Version Selects the HTTP versionUser-gent Heder Sets the HTTP User-gent Heder. If none is

specified the defult HttpClient heder is

Page 39: Soapui Notes

usedRequest Compression Selects the request compression type

Response CompressionIndictes if compressed responses from hosts re ccepted

Disble Response Decompression

Disbles decompression of compressed responses

Close connections fter request

Disbles HTTP Keep-lives by requesting to close the HTTP connection fter ech request. This will hve negtive impct on performnce but my give more relistic vlues during lod testing

Chunking ThresholdUsing content-chunking for requests lrger thn threshols, blnk to disble

uthenticte Preemptively

Send uthentiction heders with ech request without first receiving n uthentiction chllenge. This is potentil security hzrd but will improve performnce since only one request will be required for uthenticted endpoints insted of two

Expect-Continuedds Expect-Continue heder to outgoing request.

Preencoded Endpoints

Do not URL-encode endpoints, set this if your endpoint URLs re lredy URL-encoded (contining for exmple %20 or %3)

Bind ddress The locl ddress to bind to when sending requests, cn be overridden on request

Page 40: Soapui Notes

level (with the corresponding request property) nd on system level by setting the sopui.bind.ddress system vrible.

Include request in time tken

Includes the time it took to write the request in time-tken

Include response in time tken

Includes the time it took to red the response body in time-tken

Socket TimeoutThe socket timeout for HTTP requests in milliseconds

Mx Response SizeThe mximum number of bytes to red from response (0 = unlimited)

Mx Connections Per Host

The mximum number of simultneous connections to specific host. Increse this vlue if you re running LodTests with more thn 500 threds on prticulr host.

Mx Totl Connections

The totl mximum number of connections. Increse this vlue if you re running LodTests with more thn 2000 threds.

Leve MockEngine

Will leve the MockEngine running even when ll MockServices hve stopped resulting in much fster strtup-times for new MockServices nd 404 errors when trying to cll stopped MockService (insted of connection filure)

Enble Mock HTTP Log Logs wire content of ll mock requests. Selecting this option will degrde Mock

Page 41: Soapui Notes

Engine performnce mrginlly nd my require restrt to enble or disble.

2. Proxy settings tb:

Define proxy server (host, port, usernme, pssword nd excludes). lso this is where user specify whether proxy is in use or not.

Option DescriptionProxy Host The HTTP Proxy host to useProxy Port The HTTP Proxy port to use

Proxy UsernmeThe usernme sent for proxy uthentictions

Proxy PsswordThe pssword sent for proxy uthentictions

Excludes

comm-seprted list of hosts to exclude, for exmple “127.0.0.1:8080, myserver.com” will not use proxy for 127.0.0.1 on port 8080 nd myserver.com on ny port.

Enble proxy

Flg indicting if supplied proxy properties should be enbled, i.e. if proxy should be used

Page 42: Soapui Notes

.SSL Setting tb:

Define keystore, nd Mock service SSL prmeters.

Option Description

KeyStorePth to the keyStore to use when locting client certifictes

KeyStore pssword the keyStore psswordEnble Mock SSL Enbles SSL support for MockServicesMock Port The port for SSL connectionsMock KeyStore The keystore to use for SSL certifictesMock Pssword The keystore psswordMock Key Pssword The defult keys psswordMock TrustStore The truststore to use (optionl)Mock TrustStore Pssword The truststore psswordClient uthentiction Indictes if client uthentiction is required

Page 43: Soapui Notes

4. WSDL Settings Tb:

Define WSDL specific properties.

Page 44: Soapui Notes

Option DescriptionCche WSDLs Turns on nd off cching of WSDL’s

Smple VluesGenertes exmple vlues in requests when creting from schem

Type CommentGenertes comments with type informtion in new requests

Include Optionllwys includes optionl elements in generted requests

Pretty PrintPretty prints response messges in response editor

ttchment Prts

Genertes prt-elements in request messges for mime-ttchments in RPC messges (required by some ws-stcks)

No Content-Type Vlidtion

Does not vlidte the content-type of mime-ttchment ginst the type(s) specified in the SOP-Binding

Schem Directory

Specifies directory contining schem (.xsd) files tht should be utomticlly dded when prsing or vlidting wsdl or requests. Chnging the contents of this directory requires restrt.

Nme with Binding Tells SopUI to nme imported interfces with the nme of their corresponding sop/http binding, nd not with their portType. This ensures tht WSDL contining bindings for both SOP 1.1 nd

Page 45: Soapui Notes

SOP 1.2 will get unique nmes during import. This setting defults to true.

Excluded Types

list of XML-Schem types nd globl elements in the form of nme@nmespce which will be used when generting smple requests nd responses nd input forms in the SopUI Pro Form editor. By defult the XML-Schem root element is dded since it is quite common in .NET services nd genertes smple xml frgment of bout 300 kb!.

5. UI Settings Tb:

Define user interfce properties (bckup, utosve, look & feel, items ordering in tree, tooltips visibility, grbge collection intervl etc.).

Page 47: Soapui Notes

Option Description

Close Projects

Closes ll projects t strtup for improved strtup-time nd less memory consumption.

Order ProjectsSorts Projects in lphbeticl order in the nvigtor.

Order ServicesSorts Services in lphbeticl order in the nvigtor.

Order RequestsSorts Requests in lphbeticl order in the nvigtor.

Show Descriptions Show description content when vilbleSve Projects On Exit utomticlly sve ll projects on exit.

Crete BckupCretes bckup copy of projects project-file before sving.

Bckup Folder

The folder where to sve bckups, if reltive or empty the folder is reltive to the project files folder

uto Sve Intervl

Sets project uto sve intervl (in minutes). If set over 0, SopUI will utomticlly sve ll projects tht hve no running tests (both Functionl nd Lod) t the specified intervl

Desktop Type Selects which desktop lyout to use. SopUI Pro dds Tbbed Desktop s n lterntive to the defult lyout. Chnging this setting will be pplied when closing

Page 48: Soapui Notes

the preferences dilog.

6. Editor Settings Tb:

Set vrious editor properties like font, line numbers visibility, request nd response vlidtion etc.

Option Description

Editor Font

The font to be used by ll XML Editors. The “Select Font” button opens dilog for selecting the desired font nd size.

XML Line NumbersShows line-numbers by defult in ll XML-Editors (use lt-L in editors to toggle).

Groovy Line Numbers

Shows line-numbers by defult in ll Groovy-Editors (use lt-L in editors to toggle).

Page 49: Soapui Notes

Disble uto-resizeDisbles utomtic resizing of request/response editors.

Tbbed Request viewSets the tb-lyout s the defult lyout for request/response editors.

Vlidte Requests

Turns on utomtic vlidtion of requests before they re submitted from request editor. The vlidtion performed is the sme s when pressing lt-V in the editor.

bort on Invlid

Enbled in conjunction with “Vlidte Requests”, if selected ny requests tht fil vlidtion will not be submitted.

Vlidte Responses

Turns on utomtic vlidtion of response messges when they re received in response editor. The vlidtion performed is the sme s when pressing lt-V in the editor.

7. Tools Tb:

Define externl tools executbles. To run tools from the Tools min ppliction menu, their executbles must be defined here.

Page 50: Soapui Notes

Option DescriptionJBossWS wstools Loction of JBossWS wstoolsJX-RPC WSCompile Loction of JX-RPC wscompileJX-WS WSImport Loction of JX-WS wsimportxis 1.X Loction of xis 1.X

Page 51: Soapui Notes

xis 2.X Loction of xis 2.X.NET 2.0 wsdl.exe Loction of .NET 2.0 wsdl.exeXFire 1.X Loction of XFire 1.XCXF 2.X Loction of CXF 2.X

8. WS-I Settings Tb:

Define WS-I tools properties.

Option DescriptionVerbose Sets verbose output of WS-I tools

Results TypeSets which results to show in the generted report

Messge Entry Shows messge entries in report

Page 52: Soapui Notes

Filure MessgeIncludes defined filure messges in report

ssertion DescriptionIncludes description of ech test ssertion in report

Tool Loction Locl pth to instlled WS-I test tools

Show LogShows Log window when running WS-I tools

Output Folder

If specified, generted HTML reports will utomticlly be exported to this folder, which is required when running ws-i vlidtion from the commnd-line or one of the Mven plug-ins

9. Globl Properties :

Define custom globl ppliction properties.

Option Description

Enble OverrideEnbles overriding of ny property-reference with globl properties

10. Globl Security Settings Tb

Define pssword for shdowing proxy pssword in settings file.

Option Description

PsswordPssword for shdowing proxy pssword in settings file

Page 53: Soapui Notes

11. WS- Settings

Define prmeters relted to web services ddressing.

Option Description

Sop ction Overrides WS-S ction

If present in the WSDL sop ction overrides ws:ction

12. lodUI Settings Tb

Define pth to lodUI nd integrtion ports.

Option DescriptionlodUI.bt(.sh) folder Pth to lodUI executble

13. Web Recording Settings Tb

Define request heders to exclude during web recording.

Option Description

Excluded heders

Request heders to exclude from recording

14. SopUI Pro Tb

Set SopUI Pro specific properties.

Page 54: Soapui Notes

Option Description

Defult Request EditorSets the defult Messge Editor to use when Request is opened

Defult Response EditorSets the defult Messge Editor to use when Response is received

Outline Editor Limit

Defines the mximum size of messges to hndle in the outline editor; since the outline editor consumes lrge mount of memory, setting limit relted to one ��s own memory settings is encourged

Form Editor Limit

Defines the mximum size of messges to hndle in the form editor; since the form editor consumes lrge mount of memory, setting limit relted to one ��s own memory settings is encourged

Tble Inspector Columns

Sets the mximum number of columns displyed by the Tble Inspector (due to performnce resons).

Script LibrryPrt to folder contining groovy object scripts tht should be globly vilble

Disble Reporting Disble reporting to preserve memory

Complete Error LogsLogs complete messges to reports on errors

Custom Report LibrryPth to folder contining custom jsper templtes or reports

15. Coverge Settings Tb

Page 55: Soapui Notes

Enble or disble utopreprtion of coverge reports.

Option Description

uto Prepre

utomticlly prepres for Coverge clcultion when opening window contining Coverge content.

16. Code Templtes Tb

Define code templtes.

Option Descriptiondd dds new templteDelete Removes selected templteRestore Restores templtes to defult settings

17. JDBC Drivers Properties Tb

Declre jdbc drivers nd their connection string ptterns.

Option Descriptiondds driver to the driver listRemoves selected driver from the driver listLods driver vlues from n externl fileRelods defult driver settings

Page 56: Soapui Notes

ject encryption

There my be situtions when you need to ensure your projects re encrypted or secured to prevent misuse of your projects. SOPUI tool provides the project encryption feture to encrypt / secure your project using secure project pssword.

Follow the steps discussed to encrypt your project in SOPUI.

Step 1: Click on the Project nme.

Page 57: Soapui Notes

Step 2: In the properties pne of the project, there is n option ��Project Pssword ��to provide the pssword for project encryption.

Step 3: Now enter pssword for the project in the Project Pssword field nd press enter to confirm your pssword.

Page 58: Soapui Notes

Step 4: Now your project ppers with (E symbol) ner the project nme in the Nvigtor pne s shown in the imge below.

Step 5: Click on File à sve ll projects to sve the chnges mde to the projects.

Now to check if the project is encrypted, follow the steps discussed below.

Step 1: Crete new workspce using the options, File à New workspce.

Page 59: Soapui Notes

Step 2: Now SOPUI will prompt to enter workspce nme nd sve ll the projects in the current workspce. Click yes to sve ll the projects.

Page 62: Soapui Notes

(OR)

Click on File à Recent à Workspces à Choose Old workspce nme from the dropdown menu.

Page 63: Soapui Notes

Step 4: While switching the workspces, SOPUI prompts for the encrypted project vilble in the old workspce s shown below.

Page 64: Soapui Notes

Step 5: Enter the vlid pssword nd click OK to open the encrypted projects.

Note: n encrypted project creted in workspce cn be opened in tht workspce without providing pssword.

Page 65: Soapui Notes

Thus projects cn be encrypted in SOPUI tool both in bet nd Pro versions.

Import Projects into SOPUI

Page 66: Soapui Notes

In this tutoril, we will see how to import existing projects into sopui. To crete project in sopui, go through how to crete new project in sopui tutoril.

Follow the steps in detil below to import projects into sopui.

Step 1: Right click on Projects in Nvigtor pne nd select Import Project from the dropdown menu or press Ctrl+I s shown below.

Page 67: Soapui Notes

Step 2: Selecting Import project will llow you to select project from folder loction.

Page 68: Soapui Notes

Step 3: Select project (*.xml) nd click Open.

Page 70: Soapui Notes

Note: fter importing, SopUI does check of the project to see tht it is consistent nd hs ll necessry externl dependencies vilble ( process clled ��resolving ��). If errors re found Resolve dilog is displyed with ll errors nd giving you options to resolve them s shown below:

Functionl Testing – Getting Strted…

Page 71: Soapui Notes

SopUI is the Swiss-rmy knife of utomted Functionl nd Regression Testing. Powerful nd innovtive fetures help you vlidte nd improve the qulity of your services nd pplictions. Best of ll, you don’t hve to be developer to write Functionl Tests in SopUI. So whether you’re creting new TestSuites, dding TestCses, or dding ssertions to your TestCses, it’s ll mzingly simple nd esy.

In this tutoril, let ��s see how to dd request to the test suite nd test cse nd run the request from within the test suite.

Before strting this tutoril, crete new project using WSDL in SOPUI s discussed in the previous tutorils.

Follow the steps below to run the request using test suite.

Step 1: In the project creted click on the request nme s shown in the imge below.

Step 2: Click on (dd request to test cse) icon s shown in the imge bove in the request window.

Page 72: Soapui Notes

Step 3: Crete TestSuite window ppers s shown below.

Step 4: Enter test suite nme of your choice nd click on OK.

Step 5: Enter user defined test cse nme in the Crete TestCse window s shown in the imge below nd click on OK.

Page 73: Soapui Notes

Step 6: In the dd request to test cse enter user defined nme nd click on OK.

Step 7: Thus the request is successfully dded to the testcse in testsuite s shown in the imge below.

Page 75: Soapui Notes

DD SSERTION:

Follow the steps below to dd ssertion to request.

Step 1: Click on the icon (dd ssertion to the request) s shown below to dd n ssertion in your request window.

Step 2: This will disply dd ssertion window s shown below.

Page 76: Soapui Notes

s you cn see in the bove imge, there re vrious types of ssertions tht cn be dded to vlidte your response.

The vrious types of ssertions re discussed in detil in types of ssertions tutoril. Let ��s dd SL ssertion for the request in this tutoril using the step by step procedure mentioned below.

Page 77: Soapui Notes

Step 3: Click on SL ssertion nd select Response SL option to vlidte the response time for the request sent.

Page 78: Soapui Notes

Step 4: Thus SL ssertion is dded successfully s shown in the imge below. To see the ssertions, vilble for request click ssertions tb t the bottom of the request window.

Note: Before running the request for SL ssertion, set the response time limit for the ssertion by double clicking on the ssertion s shown in the imge below.

RUN Request:

Note: There re mny wys of running request.

In this tutoril, we will see

How to run the request directly? How to run t testcse level?

Run the request directly:

Step 1: Now tht n ssertion is dded, you cn vlidte your response using the ssertion by running the request directly clicking on RUN.

Page 79: Soapui Notes

ssertion- VLID:

Page 80: Soapui Notes
Page 83: Soapui Notes

Run the request t TestCse level:

Step 1: Click on the TestCse nme to open the testcse window nd click on RUN to run the testcse request s shown below.

Page 84: Soapui Notes
Page 86: Soapui Notes

VLID ssertion:

Page 88: Soapui Notes

Invlid ssertion:

Page 90: Soapui Notes

RETE nd RUN TestSuites

Before we crete testsuites in SOPUI, let ��s see some of the key terms involved in structuring the tests in functionl testing.

SopUI structures functionl tests into three levels.

TestSuite is collection of TestCses tht cn be used for grouping functionl tests into logicl units. ny number of TestSuites cn be creted inside sopUI project to support mssive testing scenrios.

TestCse is collection of TestSteps tht re ssembled to test some specific spect of your service(s). You cn dd ny number of TestCses to contining TestSuite nd even modulrize them to cll ech other for complex testing scenrios.

Page 91: Soapui Notes

TestSteps re the “building blocks” of functionl tests in sopUI. They re dded to TestCse nd used control the flow of execution nd vlidte the functionlity of the service(s) to be tested.

Let ��s see how to crete nd run test suites for project in SOPUI using the steps given below.

TestSuites cn be dded/creted to project in 2 wys.

TestSuites cn be creted from project level. TestSuites cn be generted for binding in project.

Let ��s see both the wys one by one.

CRETE TestSuites from project level:

Note: This cn be done in 3 wys s shown in steps below.

Page 92: Soapui Notes

Step 1:Method 1:

Right click on project nme nd select New TestSuite or press Ctrl + T s shown in the imge below.

Method 2:

Page 93: Soapui Notes

You cn lso crete testsuite by double clicking on Project nme nd choose testsuites tb s shown in the imge below.

Click on icon (Crete new TestSuite in this project) to dd new test suite.

Step 2: In the New TestSuite window, enter testsuite of your choice nd Click OK s shown below.

Page 94: Soapui Notes

Thus testsuite is creted successfully s shown below.

Method 3:

Step 1: TestSuites cn be dded in project when creting new project in SOPUI by checking the option ��Crete testsuite for the imported WSDL or WDL �� nd Click OK s shown in the imge below.

Page 95: Soapui Notes

Step 2: Generte TestSuite window ppers s shown in the imge below.

Page 96: Soapui Notes

Step 3: Enter nme for the testsuite generted nd click OK.

Thus testsuite is creted successfully s shown below with the testsuite window.

Page 99: Soapui Notes

Step 1: Right Click on the binding nme nd select Generte TestSuite option from the drop down menu s shown in the imge below.

Step 2: Generte TestSuite window ppers s shown in the imge below.

Page 101: Soapui Notes

Thus testsuite is creted successfully s shown below with the testsuite window.

Testsuite window:

Page 103: Soapui Notes

So fr, you hve seen how to crete test suites using the bove methods. Now, let ��s see how to run request in testsuite using the steps below.

Step 1: Double click on the TestSuite nme in the nvigtor pne to open the testsuite editor.

Page 105: Soapui Notes

There re 3 different wys of running testcses in TestSuites.

Run selected testcses in sequence Run selected testcses in prllel

Run selected testcses in sequence:

To run testcses in sequence click on icon nd click on Run in the testcse editor s shown in the imge below.

Page 108: Soapui Notes

To run testcses in prllel, click on icon nd click on Run in the testcse editor s shown in the imge below.

RETE nd RUN TestSuites

Before we crete testsuites in SOPUI, let ��s see some of the key terms involved in structuring the tests in functionl testing.

SopUI structures functionl tests into three levels.

TestSuite is collection of TestCses tht cn be used for grouping functionl tests into logicl units. ny number of TestSuites cn be creted inside sopUI project to support mssive testing scenrios.

Page 109: Soapui Notes

TestCse is collection of TestSteps tht re ssembled to test some specific spect of your service(s). You cn dd ny number of TestCses to contining TestSuite nd even modulrize them to cll ech other for complex testing scenrios.

TestSteps re the “building blocks” of functionl tests in sopUI. They re dded to TestCse nd used control the flow of execution nd vlidte the functionlity of the service(s) to be tested.

Let ��s see how to crete nd run test suites for project in SOPUI using the steps given below.

TestSuites cn be dded/creted to project in 2 wys.

TestSuites cn be creted from project level. TestSuites cn be generted for binding in project.

Let ��s see both the wys one by one.

CRETE TestSuites from project level:

Page 110: Soapui Notes

Note: This cn be done in 3 wys s shown in steps below.

Step 1:Method 1:

Right click on project nme nd select New TestSuite or press Ctrl + T s shown in the imge below.

Page 111: Soapui Notes

Method 2:

You cn lso crete testsuite by double clicking on Project nme nd choose testsuites tb s shown in the imge below.

Click on icon (Crete new TestSuite in this project) to dd new test suite.

Page 112: Soapui Notes

Step 2: In the New TestSuite window, enter testsuite of your choice nd Click OK s shown below.

Thus testsuite is creted successfully s shown below.

Method 3:

Step 1: TestSuites cn be dded in project when creting new project in SOPUI by checking the option ��Crete testsuite for the imported WSDL or WDL �� nd Click OK s shown in the imge below.

Page 113: Soapui Notes

Step 2: Generte TestSuite window ppers s shown in the imge below.

Page 114: Soapui Notes

Step 3: Enter nme for the testsuite generted nd click OK.

Thus testsuite is creted successfully s shown below with the testsuite window.

Page 117: Soapui Notes

Step 1: Right Click on the binding nme nd select Generte TestSuite option from the drop down menu s shown in the imge below.

Step 2: Generte TestSuite window ppers s shown in the imge below.

Page 119: Soapui Notes

Thus testsuite is creted successfully s shown below with the testsuite window.

Testsuite window:

Page 121: Soapui Notes

So fr, you hve seen how to crete test suites using the bove methods. Now, let ��s see how to run request in testsuite using the steps below.

Step 1: Double click on the TestSuite nme in the nvigtor pne to open the testsuite editor.

Page 123: Soapui Notes

There re 3 different wys of running testcses in TestSuites.

Run selected testcses in sequence Run selected testcses in prllel

Run selected testcses in sequence:

To run testcses in sequence click on icon nd click on Run in the testcse editor s shown in the imge below.

Page 126: Soapui Notes

To run testcses in prllel, click on icon nd click on Run in the testcse editor s shown in the imge below.

nsfer property

Property Trnsfer TestSteps re used to trnsfer properties between TestSteps(Requests) nd their contining TestCse, TestSuite nd Project. They re extremely useful in number of situtions, especilly when properties contining XML re involved.

This tutoril involves,

Extrcting vlue from n XML messge Write vlue into n XML messge Trnsfer complex XML content between properties

Follow the steps below to trnsfer properties between TestSteps inside testsuite.

Page 127: Soapui Notes

Step 1: To trnsfer property within the request, right click on teststep nd select Insert step à Property Trnsfer from the dropdown menu.

Step 2: In the Insert Step window, enter userdefined nme for the property trnsfer teststep nd click OK.

Page 130: Soapui Notes

Step 3: Click on icon to dd new property trnsfer to the property trnsfer editor window.

Step 4: Enter property trnsfer nme nd click OK in the dd trnsfer to dd the property to the property trnsfer editor window s shown in the imge below.

Page 132: Soapui Notes

The vrious tbs nd options vilble in the property trnsfer editor window re s follows.

The Source re t the top specifies the source property nd optionl XPth for the trnsfer The Trget re under tht specifies the trget property nd optionl XPth for the trnsfer The re below tht holds different configurtion options set on trnsfer to trnsfer level. The Trnsfer Log t the bottom shows the ltest executed trnsfers while the window ws open nd their ctul

trnsferred vlues.

The vilble configurtion options cn drsticlly chnge wht is trnsferred nd their respective is defined s:

Fil trnsfer on error – The trnsfer step will fil in cse ny errors hppen while ttempting to perform the trnsfer

Trnsfer text content – Only text content will be trnsferred. No structurl elements will be preserved

Trnsfer to ll – The mtched vlues will be trnsferred to ll the trget loctions in cse there re severl tht mtches

Entitize trnsferred vlues – The vlues will hve certin chrcters for exmple mpersnd (“&”) replced with it’s corresponding chrcter entity vlue (“&”)

Set null on missing source – The trget will be set to null in cse the source resource is missing. This mens tht if the trget lredy hs vlue it will be lost

Page 133: Soapui Notes

Ignore empty/missing vlues – This mens tht if the mtched vlue of the source is empty or missing it will be ignored nd the trget vlue left untouched

Use XQuery – SopUI will ssume tht the source is XQuery rther thn the defult XPth when trying to extrct the source vlues

Trnsfer child nodes – SopUI will not ttempt ny textul extrction from the mtched source node but rther pick the children of the mtched node nd thus preserving the subtree XML structure

Step 4: Now in the property trnsfer teststep editor window, choose the source property nd the trget property by providing the xpth s shown in the imge below.

Page 135: Soapui Notes

Step 5: Now click on run icon to test whether the property is getting trnsferred successfully. The result cn be viewed in the trnsfer log s shown in the imge below.

Note: Before running the property trnsfer editor, check if the source property (xpth) is not empty/null. Otherwise the property vlue while property trnsfer will be null (since Set null for missing source option is checked).

Page 136: Soapui Notes
Page 138: Soapui Notes

Running the testcse to check property trnsfer:

Now, let ��s run the testcse to check whether the property is getting trnsferred successfully between the requests. Follow the steps discussed below to verify property trnsfer is successful.

Step 1: Now click on the testcse nme to run the teststeps vilble in the testcse in the editor window s shown in the imge below.

Page 141: Soapui Notes

Thus properties cn be trnsferred between requests (from xml content) t testcse level.

nsfer property

Property Trnsfer TestSteps re used to trnsfer properties between TestSteps(Requests) nd their contining TestCse, TestSuite nd Project. They re extremely useful in number of situtions, especilly when properties contining XML re involved.

This tutoril involves,

Extrcting vlue from n XML messge Write vlue into n XML messge Trnsfer complex XML content between properties

Page 142: Soapui Notes

Follow the steps below to trnsfer properties between TestSteps inside testsuite.

Step 1: To trnsfer property within the request, right click on teststep nd select Insert step à Property Trnsfer from the dropdown menu.

Page 143: Soapui Notes

Step 2: In the Insert Step window, enter userdefined nme for the property trnsfer teststep nd click OK.

Page 145: Soapui Notes

Step 3: Click on icon to dd new property trnsfer to the property trnsfer editor window.

Step 4: Enter property trnsfer nme nd click OK in the dd trnsfer to dd the property to the property trnsfer editor window s shown in the imge below.

Page 147: Soapui Notes

The vrious tbs nd options vilble in the property trnsfer editor window re s follows.

The Source re t the top specifies the source property nd optionl XPth for the trnsfer The Trget re under tht specifies the trget property nd optionl XPth for the trnsfer The re below tht holds different configurtion options set on trnsfer to trnsfer level. The Trnsfer Log t the bottom shows the ltest executed trnsfers while the window ws open nd their ctul

trnsferred vlues.

The vilble configurtion options cn drsticlly chnge wht is trnsferred nd their respective is defined s:

Fil trnsfer on error – The trnsfer step will fil in cse ny errors hppen while ttempting to perform the trnsfer

Trnsfer text content – Only text content will be trnsferred. No structurl elements will be preserved

Trnsfer to ll – The mtched vlues will be trnsferred to ll the trget loctions in cse there re severl tht mtches

Entitize trnsferred vlues – The vlues will hve certin chrcters for exmple mpersnd (“&”) replced with it’s corresponding chrcter entity vlue (“&”)

Set null on missing source – The trget will be set to null in cse the source resource is missing. This mens tht if the trget lredy hs vlue it will be lost

Page 148: Soapui Notes

Ignore empty/missing vlues – This mens tht if the mtched vlue of the source is empty or missing it will be ignored nd the trget vlue left untouched

Use XQuery – SopUI will ssume tht the source is XQuery rther thn the defult XPth when trying to extrct the source vlues

Trnsfer child nodes – SopUI will not ttempt ny textul extrction from the mtched source node but rther pick the children of the mtched node nd thus preserving the subtree XML structure

Step 4: Now in the property trnsfer teststep editor window, choose the source property nd the trget property by providing the xpth s shown in the imge below.

Page 150: Soapui Notes

Step 5: Now click on run icon to test whether the property is getting trnsferred successfully. The result cn be viewed in the trnsfer log s shown in the imge below.

Note: Before running the property trnsfer editor, check if the source property (xpth) is not empty/null. Otherwise the property vlue while property trnsfer will be null (since Set null for missing source option is checked).

Page 151: Soapui Notes
Page 153: Soapui Notes

Running the testcse to check property trnsfer:

Now, let ��s run the testcse to check whether the property is getting trnsferred successfully between the requests. Follow the steps discussed below to verify property trnsfer is successful.

Step 1: Now click on the testcse nme to run the teststeps vilble in the testcse in the editor window s shown in the imge below.

Page 156: Soapui Notes

Thus properties cn be trnsferred between requests (from xml content) t testcse level.

Working with properties

Properties re centrl spect of more dvnced testing with sopUI ( generl overview of property-mngement is vilble t ..). In regrd to Functionl Testing properties re used to prmeterize the execution nd functionlity of your tests.

Some scenrios where properties cn be used nd customized re s follows.

Properties cn be used to hold the endpoints of your services, mking it esy to chnge the ctul endpoints used during test.

Page 157: Soapui Notes

Properties cn be used to hold uthentiction credentils, mking it esy to mnge these in centrl plce or externl file.

Properties cn be used to trnsfer nd shre session ids during test execution, so multiple teststeps or testcses cn shre the sme sessions.

In this tutoril, let ��s see some of the bsics bout properties involved t ll levels like project, testsuite, testcse, test requests level in SOPUI.

DEFINE PROPERTIES:

Properties cn be defined t vrious levels in SOPUI s follows:

t the Project, TestSuite nd TestCse level in the corresponding Properties tb In Properties TestStep

Let ��s see how these properties re defined t vrious levels in the tutoril below.

t the Project, TestSuite nd TestCse:

Project level:

Step 1: To view the properties defined t testsuite level, click on testsuite nme s shown in the imge below.

Page 159: Soapui Notes

Step 2: s shown in the imge, properties cn be dded in the project level by clicking on the icon vilble in the properties pne nd the overview tb shown in the bove imge.

Step 3: In the dd Property window, enter property nme nd click OK.

Page 160: Soapui Notes

Step 4: Now enter vlue for this property dded nd thus property is successfully dded to the project s shown below.

Page 162: Soapui Notes

TestSuite Level:

Step 1: To view the properties defined t project level, click on Project nme s shown in the imge below.

Page 164: Soapui Notes

Step 2: s shown in the imge, properties cn be dded in the testsuite level by clicking on the icon vilble in the properties pne nd the overview tb shown in the bove imge.

Step 3: In the dd Property window, enter property nme nd click OK.

Page 165: Soapui Notes

Step 4: Now enter vlue for this property dded nd thus property is successfully dded to the project s shown below.

Page 167: Soapui Notes

TestCse:

Follow the sme steps discussed for dding properties in testsuites nd project to dd properties t testcse level s shown in the imge below.

Page 168: Soapui Notes
Page 170: Soapui Notes

Note:

Properties dded t project level cn be used nywhere in tht project. Properties dded t testsuite level nd testcse level cn be used within their respective child components.

o For eg: property creted in testsuite level cn be used within tht testsuite nd not in ny other testsuites in tht project.

In Properties TestStep

The Properties step is used for defining custom properties to be used within TestCse.

Its min dvntges over defining properties t the TestCse level or ny other levels re:

You cn orgnize properties into multiple Properties TestSteps (if you hve mny of them)

You cn specify source nd trget filenmes which will be used to red nd write the contined properties when the TestStep is executed.

We cn define properties t TestStep level using the steps discussed below.

Step 1: Right click on TestSteps inside testsuite nd dd step à Properties s shown in the imge.

Page 172: Soapui Notes

Step 3: Click on the icon vilble in the properties editor window to dd new property.

Step 4: In the dd Property window, enter property nme nd click OK.

Now properties re dded successfully to the Properties TestStep s shown in the imge below.

Page 173: Soapui Notes

Lern more bout importing nd exporting properties, property trnsfer, etc., in other tutorils.

Generte reports for your projects

Now we hve executed ll our teststeps in the testcses. Next, is to hve totl summry bout the project execution. This is possible in SOPUI.

SOPUI provides three types of reports which cn be generted from inside the UI t Project, TestSuite, TestCse nd LodTest level:

Printble Reports – Cn be printed or sved s PDF, HTML, RTF, Word, Excel, etc nd re fully customizble on both globl nd project level, llowing you to crete nd customize ny kind of report you my require.

Page 174: Soapui Notes

Dt Export – llows export of underlying report-dt in XML nd csv formt. This is useful if you wnt to import report dt into other tools for custom reporting or integrtions.

HTML Reports – Give simplified overview of functionl test results in HTML formt (not vilble t LodTest level).

Note: The Open Source version of sopUI (Bet version) only supports cretion of the bsic HTML reports when running from the Commnd Line. The bove 3 types of reports re supported in Pro version.

Let ��s see how to crete or generte report for the project WSDL file in SOPUI using the steps discussed below.

Before strting this tutoril, lern how to crete project using WSDL in the previous tutorils.

Step 1: Click on the project binding nme s shown in the imge to view the WSDL content of the project.

Page 175: Soapui Notes

Step 2: In the WSDL content tb shown below, click on icon to generte the HTML documenttion (report) for the WSDL file in the project.

Page 176: Soapui Notes

Step 3: Clicking on the icon will prompt to choose the loction to sve the document.

Page 177: Soapui Notes

Step 4: Clicking on OK will generte the document in the defult browser vilble in your system s shown in the imge below.

Page 178: Soapui Notes
Page 180: Soapui Notes

Note: when generting HTML document for the WSDL, the wsdl file lso gets sved in the sme folder loction.

The HTML document generted for the bove WSDL file is shown below.

wsdl-report

The other types of reporting will be supported only in SOPUI Pro.

MockServices – Getting Strted…

Before we ctully go into how to mock service, lets get to know some bsic concepts of mocking.

 

You would hve few questions in your mind such s,

Wht is mocking ll bout? When should I mock service? Wht re the dvntges in mocking service? Best prctices involved in mocking?

 

Lets find the nswers for the bove questions.

 

Page 181: Soapui Notes

First of ll, wht is mocking service?

definition from book cn be given s ��Service Mocking, or simultion, is the prctice of creting fcsimile environment tht works similr to the environment youre fcsimileing�� .�� 

In simple words, mocking is nothing but Isoltion, Simultion, or Virtuliztion, but those re term bsiclly creted to move the lowly prctice of mocking higher into the vlue chin. So, for ll purposes Isoltion, Simultion, nd Virtuliztion re the sme s mocking, just much more expensive.

 

Now we know wht is mocking.

 

Next, when should I use mock service?

The nswer to the bove question is simple. You should use mocks when you cnt use the rel thing. Of course its �� ��not tht esy when you look into it more crefully. The detiled nswer for this question is vilble in the next question.

 

Wht re the uses of mock services?

You cn crete tests in dvnce Tems cn work in prllel

Page 182: Soapui Notes

Crete proof of concepts or demos Write test for resource not ccessible Mock cn be delivered to the customer Sve yourself from the money pit Isolte systems Test the Live Environments before you hve the service in it

 

Not tht it hs the bove dvntges; there re lso few disdvntges tht you need to know when you re mocking service.

Double work Deployment constrints Mocks gets bugs Its not live�� Enter the Uncnny Vlley

 

The drwbcks bove side, Mocking is extremely powerful used correctly, nd cn sve lot of time nd money for you. Lets see some of the best prctices of the mock services.

Strt smll nd expnd. Only Deep Mock wht you need to Deep Mock. gree on wht the scope is nd how rel it should be�� �� Think of reuse Get buy in. Go deep. Relly deep! Consider the cloud

Page 183: Soapui Notes

 Skunk it! WR – Deploy

 

Create Mock Services

 

Lets see how to mock service in SOPUI Bet (Open source version). Services cn lso be mocked in SOPUI Pro using the sme procedure.

Before you crete mock service, lern to crete project in SOPUI using the previous tutorils.

Follow the steps to mock service.

Step 1: You cn crete mock service while creting new project in SOPUI using File à New SOPUI project s shown below in the imge.

Page 184: Soapui Notes

 

Step2: Check Crete MockService checkbox to crete mock service during the project cretion nd click OK.

                                                                                                                               (Or)

Step 1: You cn lso generte mockservice for n lredy creted project by right clicking on the project binding nme nd choosing Generte MockService s shown in the imge below.

 

Page 185: Soapui Notes

 Step 2:  Clicking on tht will open the Generte MockService dilog box s shown in step 3.

Step 3: In the Generte MockService window, choose the opertions in the WSDL to be mocked nd click OK.

Page 186: Soapui Notes

 

Note:

The Pth nd Port for the mockservice will be specified utomticlly by SOPUI. If you wish to edit the port nd pth, you cn do it in this window.

If you check on Strt MockService, it will strt the mockservice when you click OK.

Page 187: Soapui Notes

 

Step 4: Clicking OK will prompt to specify the mockservice nme. Enter nme nd click OK s shown below.

Thus mock service is creted successfully s shown below.

Page 189: Soapui Notes

 

Note: In mockservice you will find response insted of request which needs to hrd-coded. This response will be used in nother request.

Run Mock Services

 

 

 

Now you hve creted mock service for your project using the previous tutoril. Lets see how to run the services in�� SOPUI.

 

But before tht s sid, you need to hrd-code your response to run your mockservices. Lets see how to hrd-code ��your mockservice response.

Step 1:  To hrd-code your mockservice opertion click on mock service nd this opens the editor s shown in the imge below.

Page 191: Soapui Notes

Step 2: Click on the opertion nme in the mockservice editor nd gin the response nme in the opertion window to hrdcode the response.

Step 3:  The response editor window is shown below. Hrd-code the tg vlues to run the mock service.

Page 192: Soapui Notes

 

Note: You hve to know the output prior to hrd-code the response.

Thus the output is hrd-coded s shown below.

Page 193: Soapui Notes

 

Run your mock services:

Follow the steps to run your mockservice.

Step 1: Click on the Mockservice nme nd in the editor window click on  (run icon) to run the mockservice in SOPUI.

Page 195: Soapui Notes

 

Step 2: Now mockservice runs successfully on the port s shown below.

Now using the endpoint of the mockservice you cn run your request.

mponents of SOPUI project window

Page 196: Soapui Notes

 

 

 

In this tutoril, you will see the vrious components of the SOPUI window when you crete project re explined in detil using screenshots.

 

1. Click on Project Nme. In the previous tutoril, we hve creted project, Test Project. You cn see window s shown below when you click on Overview Tb in the right pne.

 

Overview tb – Displys the Generl informtion of ll the components vilble in project.

Page 198: Soapui Notes

 

Testsuites tb- Describes the informtion bout the test suites creted by the user in project nd used to run the test suites nd shows the log for executed test suites.

 

Page 200: Soapui Notes

2. Bindings - This will hve the WSDL definition detils, opertions/services vilble in WSDL file. Click on Binding nme to view the detils s shown in the imge below.

Overview tb – Displys the Generl informtion such s wsdl definition nd opertions.

 

Page 202: Soapui Notes

 

Service Endpoints – Endpoints in wsdl describes where the service needs to hit when request is sent. The Service endpoints tb displys the endpoints used in project.

 

 

 

 

Page 203: Soapui Notes

WSDL Content: This tb displys the rw form of wsdl nd its binding components involved. Clicking on WSDL tb displys the window s shown below.

Page 205: Soapui Notes

Note: You cn lso see the rw form of WSDL by psting the WSDL URL in browser s shown below.

Page 207: Soapui Notes

 

3. Request - Click on Request nme to disply the window s shown below.

 

 

Page 209: Soapui Notes

 

 

 

how to run your project in SOPUI Pro???

 

 

So fr, we hve seen how to crete project in sopui pro. Now in this tutoril, lets see how to run request vilble in ��project.

In order to run project, crete project s explined the previous tutorils.  Follow the below steps to run project in SOPUI PRO.Step 1: Click on Request nme. This will disply the defult requests s shown in the imge below.

Page 210: Soapui Notes

 

Step 2: In the request, fill the vlue for the tgs with ? if you hve.�� ��

 

Step 3: Check for the service endpoint before clicking in Run button.

Page 211: Soapui Notes

Step 4:  Click on Run button s shown in the below imge

fter clicking on RUN,

 

 

Step 5: Now you cn find the response for the bove requests in the Response window.

 

Page 212: Soapui Notes

 

Thus the response for the sop request is obtined s shown in the bove imge. Thus sopui project is run successfully.

Cmponents of SOPUI project window

 

 

 

In this tutoril, you will see the vrious components of the SOPUI window when you crete project re explined in detil using screenshots.

 

1. Click on Project Nme. In the previous tutoril, we hve creted project, Test Project. You cn see window s shown below when you click on Overview Tb in the right pne.

 

Overview tb – Displys the Generl informtion of ll the components vilble in project.

Page 214: Soapui Notes

 

Testsuites tb- Describes the informtion bout the test suites creted by the user in project nd used to run the test suites nd shows the log for executed test suites.

 

Page 216: Soapui Notes

2. Bindings - This will hve the WSDL definition detils, opertions/services vilble in WSDL file. Click on Binding nme to view the detils s shown in the imge below.

Overview tb – Displys the Generl informtion such s wsdl definition nd opertions.

 

Page 218: Soapui Notes

 

Service Endpoints – Endpoints in wsdl describes where the service needs to hit when request is sent. The Service endpoints tb displys the endpoints used in project.

 

 

 

 

Page 219: Soapui Notes

WSDL Content: This tb displys the rw form of wsdl nd its binding components involved. Clicking on WSDL tb displys the window s shown below.

Page 221: Soapui Notes

Note: You cn lso see the rw form of WSDL by psting the WSDL URL in browser s shown below.

Page 223: Soapui Notes

 

3. Request - Click on Request nme to disply the window s shown below.

 

 

Page 225: Soapui Notes

 

 

 

iport nd export your properties

Now you must be fmilir bout creting properties t vrious levels such s Project level, testsuite level, testcse level, etc.,

Lets see how to import nd export these properties t vrious levels in this tutoril one by one.

IMPORT PROPERTIES

Project Level:

Step 1: Click on Project nme. In the properties pne click on Custom properties or Click on Properties tb in the Overview tb of the project in the Editor window to view the defined properties s shown in the imge below.

Page 227: Soapui Notes

 

Step 2: Click on  icon to import the properties from n externl file.

Step 3: In the Lod Property window, choose the property file from n externl file loction by clicking on Browse nd click OK.

 

Loding property file tht is not vilble in the project,

Page 229: Soapui Notes

TestSuite:

Step 1: Click on Testsuite nme. In the properties pne click on Custom properties or Click on Properties tb in the Editor window to view the defined properties s shown in the imge below.

Page 231: Soapui Notes

 

Step 2: Click on  icon to import the properties from n externl file.

Step 3: In the Lod Property window, choose the property file from n externl file loction by clicking on Browse nd click OK.

 

Loding property file tht is not vilble in the project,

Page 233: Soapui Notes

 

TestCse Level:

Follow the sme steps discussed while importing properties in testsuites nd project to import properties t testcse level s shown in the imge below.

 

 

Page 235: Soapui Notes

 

EXPORT PROPERTIES

Project Level:

 

Step 1: Click on Project nme. In the properties pne click on Custom properties or Click on Properties tb in the Overview tb of the project in the Editor window to view the defined properties s shown in the imge below.

Page 237: Soapui Notes

Step 2: Clicking on  icon prompts to sve the file in loction s shown in the imge below.

Step 3: Enter file nme for the exported properties nd click on Sve.

Import nd export your properties

Now you must be fmilir bout creting properties t vrious levels such s Project level, testsuite level, testcse level, etc.,

Lets see how to import nd export these properties t vrious levels in this tutoril one by one.

IMPORT PROPERTIES

Project Level:

Page 238: Soapui Notes

Step 1: Click on Project nme. In the properties pne click on Custom properties or Click on Properties tb in the Overview tb of the project in the Editor window to view the defined properties s shown in the imge below.

Page 240: Soapui Notes

 

Step 2: Click on  icon to import the properties from n externl file.

Step 3: In the Lod Property window, choose the property file from n externl file loction by clicking on Browse nd click OK.

 

Loding property file tht is not vilble in the project,

Page 242: Soapui Notes

TestSuite:

Step 1: Click on Testsuite nme. In the properties pne click on Custom properties or Click on Properties tb in the Editor window to view the defined properties s shown in the imge below.

Page 244: Soapui Notes

 

Step 2: Click on  icon to import the properties from n externl file.

Step 3: In the Lod Property window, choose the property file from n externl file loction by clicking on Browse nd click OK.

 

Loding property file tht is not vilble in the project,

Page 246: Soapui Notes

 

TestCse Level:

Follow the sme steps discussed while importing properties in testsuites nd project to import properties t testcse level s shown in the imge below.

 

 

Page 248: Soapui Notes

 

EXPORT PROPERTIES

Project Level:

 

Step 1: Click on Project nme. In the properties pne click on Custom properties or Click on Properties tb in the Overview tb of the project in the Editor window to view the defined properties s shown in the imge below.

Page 250: Soapui Notes

Step 2: Clicking on  icon prompts to sve the file in loction s shown in the imge below.

Step 3: Enter file nme for the exported properties nd click on Sve.

Page 252: Soapui Notes

TestSuites:

 

Follow the sme steps discussed while exporting from project to export properties from testsuite level s shown in the imge below.

 

TestCse:

Follow the sme steps discussed while exporting from project, testsuite to export properties from testcse level s shown in the imge below.

Page 254: Soapui Notes

 

Thus properties re successfully exported.

 

TestSuites:

 

Follow the sme steps discussed while exporting from project to export properties from testsuite level s shown in the imge below.

Page 255: Soapui Notes

 

TestCse:

Follow the sme steps discussed while exporting from project, testsuite to export properties from testcse level s shown in the imge below.

 

Wht is the difference between HTTP nd REST and SOAP in web services?

Page 256: Soapui Notes

SOAP

SOAP uses WSDL for communiction btw consumer nd provider, wheres REST just uses XML or JSON to send nd receive dt

WSDL defines contrct between client nd service nd is sttic by its nture. In cse of REST contrct is somewht complicted nd is defined by HTTP, URI, Medi Formts nd ppliction Specific Coordintion Protocol. It’s highly dynmic unlike WSDL.

SOP doesn’t return humn redble result, whilst REST result is redble with is just plin XML or JSON

This is not true. Plin XML or JSON re not RESTful t ll. None of them define ny controls(i.e. links nd link reltions, method informtion, encoding informtion etc…) which is ginst REST s fr s messges must be self contined nd coordinte interction between gent/client nd service.

With links + semntic link reltions clients should be ble to determine wht is next interction step nd follow these links nd continue communiction with service.

It is not necessry tht messges be humn redble, it’s possible to use cryptic formt nd build perfectly vlid REST pplictions. It doesn’t mtter whether messge is humn redble or not.

Thus, plin XML(ppliction/xml) or JSON(ppliction/json) re not sufficient formts for building REST pplictions. It’s lwys resonble to use subset of these generic medi types which hve strong semntic mening nd offer enough control informtion(links etc…) to coordinte interctions between client nd server.

REST:

REST is over only HTTP.  HTTP is most widely used nd when we tlk bout REST web services we just ssume HTTP. HTTP defines interfce with it’s methods(GET, POST, PUT, DELETE, PTCH etc) nd vrious heders which cn be used uniformly for intercting with resources. This uniformity cn be chieved with other protocols s well.

Page 257: Soapui Notes

REST permits mny different dt formts where s SOP only permits XML.

While this my seem like it dds complexity to REST becuse you need to hndle multiple formts, in my experience it hs ctully been quite beneficil. JSON usully is better fit for dt nd prses much fster. REST llows better support for browser clients due to its support for JSON.��REST doesn’t dd ny specific functionlity to HTTP but is n rchitecturl style tht ws developed longside HTTP nd most commonly uses HTTP for its ppliction lyer protocol.

HTTP:

 

HTTP is n ppliction protocol. REST is set of rules, tht when followed, enble you to build distributed ppliction tht hs specific set of desirble constrints.

If you re looking for the most significnt constrints of REST tht distinguish RESTful ppliction from just ny HTTP ppliction, I would sy the “self-description” constrint nd the hypermedi constrint (k Hypermedi s the Engine of ppliction Stte (HTEOS)) re the most importnt.

The self-description constrint requires RESTful request to be completely self descriptive in the users intent. This llows intermediries (proxies nd cches) to ct on the messge sfely.

The HTEOS constrint is bout turning your ppliction into web of links where the client’s current stte is bsed on its plce in tht web. It is tricky concept nd requires more time to explin thn I hve right now.

Estblish JDBC connection in SOPUI PRO

To estblish JDBC connection ll you need is 3 simple things,

Page 258: Soapui Notes

OJDBC 14 Jr File Dtbse Connection String Dtbse detils

Now I m gonn tell you how to estblish JDBC connection in PRO using Orcle XE (eXpress Edition).  Before you  strt this, you hve to downlod OJDBC 14 Jr file from orcle site nd plce it in the pth specified.

SmrtBer\sopUI-Pro-4.5.1\bin\ext

Now you cn proceed with the below steps to work with the connection.

Step 1: Open ur SOPUI Pro by clicking on SOPUIPro.exe

Step 2: Now choose project nd double click on it.

Step 3: In the Project editor window we hve mny tbs. Choose JDBC connections tb.

Step 4: Click on dd New Dt Connection icon.

Step 5: Specify nme for your connection.

Step 6: Now configure your dtbse connection by providing the following detils.

Driver : Choose the driver bsed on the type of Dtbse (Eg: Orcle, MySql, MSccess, etc.,)

User : Your Dtbse usernme

Pssword : Your Dtbse pssword

Dtbse : Dtbse Nme

Note: For some of the dtbses like Orcle, it will prompt for nother field clled SID (System Identifiction)

Page 259: Soapui Notes

The query to find the bove detils is s follows:

select or_dtbse_nme from dul;

select * from v$dtbse;

select * from globl_nme;

Step 7: Now test your connection by clicking on the run button.

The connection will be estblished successfully.

Running functionl tests from the commnd-line

Page 260: Soapui Notes

 

Running functionl tests from the commnd-line is strightforwrd nd simple using the included testrunner.bt/.sh script, which tkes number of rguments to control which tests to run, output, etc:

e : The endpoint to use when invoking test-requests, overrides the endpoint set in the project file h : The host:port to use when invoking test-requests, overrides only the host prt of the endpoint set in the project file s : The TestSuite to run, used to nrrow down the tests to run c : The TestCse to run, used to nrrow down the tests to run u : The usernme to use in ny uthentictions, overrides ny usernme set for ny TestRequests p : The pssword to use in ny uthentictions, overrides ny pssword set for ny TestRequests w : Sets the WSS pssword type, either ‘Text’ or ‘Digest’ d : The domin to use in ny uthentictions, overrides ny domin set for ny TestRequests r : Turns on printing of smll summry report (see below) f : Specifies the root folder to which test results should be exported (see below) j : Turns on exporting of JUnit-comptible reports, see below : Turns on exporting of ll test results, not only errors : Opens the generted report in browser (SopUI Pro only) i : Enbles SopUI UI-relted components, required if you use the UISupport clss for prompting or displying informtion t : Sets the sopui-settings.xml file to use, required if you hve custom proxy, ssl, http, etc setting x : Sets project pssword for decryption if project is encrypted v : Sets pssword for sopui-settings.xml file D : Sets system property with nme=vlue G : Sets globl property with nme=vlue P : Sets project property with nme=vlue, e.g. -Pendpoint=Vlue1 -PsomeOtherProperty=vlue2 S : Sets to sve the project file fter tests hve been run I : Do not stop if error occurs, ignore them

Page 261: Soapui Notes

R : Selects which report to generte for the test objects executed, for exmple if running the entire project, this could specify the nme of test-suite-level report tht would be generted for ech TestSuite. The report is sved s specified with the -F option to the folder specified with the -f option. (SopUI Pro only)

F : Sets the formt of the report specified with the -R option, for Printble reports this is one of PDF, XLS, HTML, RTF, CSV, TXT, nd XML. For Dt Export this is either XML or CSV (SopUI Pro only)

g : Sets the output to include Coverge HTML reports ( SopUI Pro only ) E : Sets which environment to use (SopUI Pro only)