Вы находитесь на странице: 1из 28

SOAP UI GUIDE

1
Table of Contents
Table of Contents.............................................................
1 Introduction.............................................................
2 How to create a Test Suite?..........................................
2.1 Create a Project in soapUI ...................................................5
2.2 Create Test Suite...............................................................6
How to add re!uests in a test suite?................................
.1 Create a new TestCase........................................................"
.2 Create new e#pt$ re!uest...................................................%
& 'odif$ Pass()ail reportin* option in a Test Case?...............
5 Set t+e ,ut credentials..............................................
5.1 Set t+e ,ut credentials -Userna#e and password. for a sin*le re!uest
in t+e TestCase.........................................................................1&
5.2 Set t+e ,ut credentials -Userna#e and password. for all t+e re!uests
in a TestCase...........................................................................15
6 Set end point U/0 for re!uests.....................................
6.1 1ifferent end point U/02s for different re!uests........................1"
6.2 Sa#e end3point U/0 for all t+e re!uests in a TestCase4...............1%
5 /unnin* Test/e!uests and TestCase...............................
5.1 /unnin* indi6idual Test/e!uests...........................................21
5.2 /unnin* all re!uests present in a TestCase...............................22
" ,ssertions4.............................................................
".1 ,ddin* assertions at t+e ti#e of creatin* re!uest 7'0................2&
".2 How to add assertions?......................................................26
". How to find +ow #an$ assertions +a6e been applied to a re!uest
7'0? ..................................................................................2"
2
1 Introduction
SoapUI structures functional tests into three levels; TestSuites, TestCases and
TestSteps.
1. A TestSuite is a collection of TestCases that can be used for grouping
functional tests into logical units. Any nuber of TestSuites can be created
inside a soapUI pro!ect to support assive testing scenarios.
2. A TestCase is a collection of TestSteps that are assebled to test soe
specific aspect of your service"s#. $ou can add any nuber of TestCases to a
containing TestSuite and even odulari%e the to call each other for cople&
testing scenarios.
'. TestSteps are the (building bloc)s( of functional tests in soapUI. They are
added to a TestCase and used control the flo* of e&ecution and validate the
functionality of the service"s# to be tested.
+et,s loo) at these in a little ore detail-
TestSuites "as entioned above# are created at the pro!ect level for grouping
TestCases into logical units. .or e&aple *e can have one TestSuite *ith account/
related TestCases and another for TestCases related to payents.
0ur pro!ect can contain any nuber of TestSuites and *e can see and e&ecute the all
"in se1uence or parallel# fro the 2ro!ect TestSuites tab. This has been e&plained in
detail in this docuent.
'
2 How to create a Test Suite?
2.1 Create a Project in soapUI
2.1.1 3oto .ile 4e* soapUI 2ro!ect
2.1.2 2rovide 2ro!ect 4ae and 5S6+ path "file syste path#. And press
708,.
9
2.1.' 4e* pro!ect has been created-
2.2 Create Test Suite
2.2.1 :ight clic) on the pro!ect created and select option 74e* TestSuite,
;
2.2.2 2rovide a nae for the Test Suite and press 708,
2.2.' A ne* test suite has been created, as sho*n belo*;
<
3 How to add requests in a test suite?
3.1 Create a new TestCase
'.1.1 :ight clic) on the TestSuite that you created and select option 74e*
TestCase,, as sho*n belo*-
'.1.2 2rovide a nae to the ne* TestCase and press 708,, as sho*n
belo*-
=
3.1.3 A ne* TestCase has been created inside out TestSuite, as sho*n
belo*;
3.2 Create new empty reuest.
'.1.1 :ight clic) on the ne* TestCase that has been created and select
option 7Add Step, 7S0A2 Test :e1uest,, as sho*n belo*;
'.1.2 Specify the nae for the re1uest >?+, and press 708,, as sho*n
belo*;
@
'.1.' Then Select the operation that the re1uest *ill invo)e, as sho*n
belo*;
'.1.9 And press 708,.
'.1.; Then select the options, and press 708, again.
A
'.1.< An epty Input >?+ has been created.
1B
4 Modify Pass/Fail reportin option in a
Test !ase?
5e can declare a TestCase inside a TestSuite as .ailed, even if a single TestStep
fails inside the TestCase. This can be achieved by follo*ing the belo* entioned
steps;
!.1 :ight clic) on the 7TestCase, inside the 7TestSuite,, and select 70ptions,, as
sho*n belo*;
11
!.2 Unchec) the chec)bo& 7Abort on error, and chec) the chec)bo& 7.ail
TestCase on Crror,, and press 708,.
After a)ing these changes, a TestCase *ill be sho*n as failed if even a
single step inside the TestCase fails. And the e&ecution of the TestCase
*ill not stop *hen a TestStep fails.
12
" Set t#e $ut credentials
".1 Set t#e Aut cre$entia%s &Username an$
passwor$' (or a sin)%e reuest in t#e TestCase.
".1.1 6ouble clic) on the :e1uest, for *hich the credentials have to
added, and then select the tab 7Aut, at the botto of the re1uest, as
sho*n in the iage belo*;
".1.2 The follo*ing screen *ill appear. 2rovide 7usernae, and
7pass*ord,.
1'
".2 Set t#e Aut cre$entia%s &Username an$
passwor$' (or a%% t#e reuests in a TestCase.
;.2.1 6ouble clic) on the TestCase that you created. The follo*ing screen
*ill appear;
".2.2 Select the 78ey, present on the title bar, as sho*n in the iage
belo*;
19
;.2.' The follo*ing screen *ill appear.

".2.! 2rovide Usernae and 2ass*ord and press 708,. This *ill set
the sae usernae and pass*ord for all re1uests present in this
particular TestCase.
1;
1<
% Set end point &'( for requests
*.1 Di((erent en$ point U+,-s (or $i((erent reuests
<.1.1 6ouble clic) on the :e1uest, for *hich the end point U:+ has to be
set;
<.1.2 0n the address bar, select option 7Cdit Current, and provide the
desired end point url, and press 08;
1=
*.2 Same en$.point U+, (or a%% t#e reuests in a
TestCase/
*.2.1 6ouble clic) on the TestCase that you created. The follo*ing
screen *ill appear;
*.2.2 Select the 7U:+, button present on the title bar;
1@
*.2.3 Set the end/point U:+ and press 708. This *ill set the sae
end/point U:+ for all the re1uests present in the TestCase.
1A
) 'unnin Test'equests and Test!ase
0.1 +unnin) in$i1i$ua% Test+euests
0.1.1 6ouble clic) on the Test:e1uest that has to be run and press
run iage, present on the tool bar, as sho*n belo*;
2B
0.2 +unnin) a%% reuests present in a TestCase
=.2.1 :ight clic) on the TestCase that needs to be run, and goto 70ptions,,
as sho*n belo*;
0.2.2 The follo*ing screen *ill appear. Unchec) option 7Abort on
Crror,. And press 708,.
21
0.2.3 6ouble clic) on the TestCase that needs to be run. Screen
siilar to the follo*ing *ill appear;
=.2.9 Select the green arro*, present on the tool bar. This *ill run all the
test cases present in the TestCase.
=.2.; After all Test:e1uests inside a TestCase have been e&ecuted, the
follo*ing screen *ill appear;
22
* $ssertions+
4o* that *eDve created our test, *e are going to add a validation of the response.
In soapUI, this is called adding an assertion. soapUI contains several functions
that enhances autoation for those *ho spends their days "and nights# testing and
are in need of e&tensive assertions.
C&aples of assertions that are possible in soapUI are-
Schea Copliance
Siple Contains
Siple 4ot Contains
S0A2 .ault
4ot S0A2 .ault
S0A2 :esponse
:esponse S+A
>2ath ?atch
>Euery ?atch
Script Assertion
5S/Security Status
5S/Addressing :esponse Assertion
5S/Addressing :e1uest Assertion

2.1 A$$in) assertions at t#e time o( creatin)
reuest 34,.
2.1.1 :ight clic) on the TestCase nae in *hich the re1uest >?+
has to be added, and select option 7Add Step, 7S0A2 Test
:e1uest,
2'
@.1.2 2rovide the nae of the re1uest and press 708,.
@.1.' Select the operation fro the dropdo*n and press 708,, as sho*n
belo*;
@.1.9 The follo*ing four assertion options are provided at this stage.
5hatever option is application in your case, select those and press
708,.
29
@.1.; A ne* blan) >?+ has been created *ith the assertions applied, as
sho*n in the iage belo*;
2.2 5ow to a$$ assertions6
@.2.1 6ouble clic) and open the re1uest >?+ for *hich an assertion has to
be added. The follo*ing screen *ill appear.
2;
@.2.2 In the re1uest editor, Clic) the Add an Assertion to Test :e1uest
button.
@.2.' .ro the dropdo*n select the assertion that has to be ipleented.
C&aple / Select :esponse S+A fro the drop do*n in the Select
Assertion dialog bo&.
2<
2.2.! In the Configure :esponse S+A Assertion dialog bo&, *rite ;BB
and clic) 708,. This *ill validate that the response of the S+A is
under ;BB.
@.2.; 4o* that *e,ve added the assertion, *e are going to run the re1uest
to validate the response. If all assertions are successful, the S0A2
icon *ill turn green in three places as sho*n belo*.
2=
2.3 5ow to (in$ #ow many assertions #a1e 7een
app%ie$ to a reuest 34,6
2.3.1 The nuber of assertions that have been applied on the
:esponse can be verified fro the 7Assertion, tab. As sho*n belo*
there are 7', assertions applied on this response.
2@

Вам также может понравиться