You are on page 1of 7

7/29/2016

CompleteGuideforGUITesting

CompleteGuideforGUITesting
Therearetwotypesofinterfacesinacomputerapplication.
CommandLineInterfaceiswhereyoutypetextandcomputerrespondstothatcommand.
GUIstandsforGraphicalUserInterfacewhereyouinteractwiththecomputerusingimagesratherthantext.
FollowingaretheGUIelementswhichcanbeusedforinteractionbetweentheuserandapplication:

GUITesting,isvalidationofaboveelements.
Inthistutorial,youwilllearn

WhatisGUITesting?
GraphicalUserInterface(GUI)testingistheprocessoftestingthesystem'sGUIoftheSystemUnderTest.
GUItestinginvolvescheckingthescreenswiththecontrolslikemenus,buttons,icons,andalltypesofbars
toolbar,menubar,dialogboxesandwindows,etc.
GUIiswhatusersees.Sayifyouvisitguru99.comwhatyouwillseesayhomepageitistheGUI(graphical
userinterface)ofthesite.Auserdoesnotseethesourcecode.Theinterfaceisvisibletotheuser.
Especiallythefocusisonthedesignstructure,imagesthattheyareworkingproperlyornot.

Inaboveexample,ifwehavetodoGUItestingwefirstcheckthattheimagesshouldbecompletelyvisiblein
differentbrowsers.
http://www.guru99.com/guitesting.html

1/7

7/29/2016

CompleteGuideforGUITesting

Also,thelinksareavailable,andthebuttonshouldworkwhenclicked.
Also,iftheuserresizesthescreen,neitherimagesnorcontentshouldshrinkorcroporoverlap.

NeedofGUITesting
NowthebasicconceptofGUItestingisclear.Thefewquestionsthatwillstrikeinyourmindwillbe
WhydoGUItesting?
Isitreallyneeded?
DoestestingoffunctionallyandlogicofApplicationisnotmorethanenough??Thenwhytowastetimeon
UItesting.
Togettheanswerthinkasauser,notasatester.Auserdoesn'thaveanyknowledgeaboutXYZ
software/Application.ItistheUIoftheApplicationwhichdecidesthatauserisgoingtousetheApplication
furtherornot.
AnormalUserfirstobservesthedesignandlooksoftheApplication/Softwareandhoweasyitisforhimto
understandtheUI.IfauserisnotcomfortablewiththeInterfaceorfindApplicationcomplextounderstand
hewouldnevergoingtousethatApplicationAgain.That'swhy,GUIisamatterforconcern,andproper
testingshouldbecarriedoutinordertomakesurethatGUIisfreeofBugs.

WhatdoyouCheckinGUITesting?
ThefollowingchecklistwillensuredetailedGUITesting.
CheckalltheGUIelementsforsize,position,width,lengthandacceptanceofcharactersornumbers.For
instance,youmustbeabletoprovideinputstotheinputfields.
CheckyoucanexecutetheintendedfunctionalityoftheapplicationusingtheGUI
CheckErrorMessagesaredisplayedcorrectly
CheckforCleardemarcationofdifferentsectionsonscreen
CheckFontusedinapplicationisreadable
Checkthealignmentofthetextisproper
ChecktheColorofthefontandwarningmessagesisaestheticallypleasing
Checkthattheimageshavegoodclarity
Checkthattheimagesareproperlyaligned
CheckthepositioningofGUIelementsfordifferentscreenresolution.

ApproachofGUITesting
GUItestingcanbedonethroughthreeways:
ManualBasedTesting
Underthisapproach,graphicalscreensarecheckedmanuallybytestersinconformancewiththe
requirementsstatedinthebusinessrequirementsdocument.

http://www.guru99.com/guitesting.html

2/7

7/29/2016

CompleteGuideforGUITesting

RecordandReplay
GUItestingcanbedoneusingautomationtools.Thisisdonein2parts.DuringRecord,teststepsare
capturedbytheautomationtool.Duringplayback,therecordedteststepsareexecutedontheApplication
UnderTest.ExampleofsuchtoolsQTP.

ModelBasedTesting

Amodelisagraphicaldescriptionofsystem'sbehavior.Ithelpsustounderstandandpredictthesystem
behavior.Modelshelpinagenerationofefficienttestcasesusingthesystemrequirements.Followingneeds
tobeconsideredforthismodelbasedtesting:
Buildthemodel
http://www.guru99.com/guitesting.html

3/7

7/29/2016

CompleteGuideforGUITesting

DetermineInputsforthemodel
Calculateexpectedoutputforthemodel
Runthetests
Comparetheactualoutputwiththeexpectedoutput
Decisiononfurtheractiononthemodel
Someofthemodelingtechniquesfromwhichtestcasescanbederived:
ChartsDepictsthestateofasystemandchecksthestateaftersomeinput.
DecisionTablesTablesusedtodetermineresultsforeachinputapplied
Modelbasedtestingisanevolvingtechniqueforthegeneratingthetestcasesfromtherequirements.Its
mainadvantage,comparedtoabovetwomethods,isthatitcandetermineundesirablestatesthat
yourGUIcanattain.
FollowingareopensourcetoolsavailabletoconductGUITesting.
Product

LicensedUnder

AutoHotkey

GPL

Selenium

Apache

Sikuli

MIT

RobotFramework

Apache

Water

BSD

DojoToolkit

BSD

GUITestingTestCases
GUITestingbasicallyinvolves
1.Testingthesize,position,width,heightoftheelements.
2.Testingoftheerrormessagesthataregettingdisplayed.
3.Testingthedifferentsectionsofthescreen.
4.Testingofthefontwhetheritisreadableornot.
5.Testingofthescreenindifferentresolutionswiththehelpofzoominginandzoomingoutlike640x480,
600x800,etc.
6.Testingthealignmentofthetextsandotherelementslikeicons,buttons,etc.areinproperplaceornot.
7.Testingthecolorsofthefonts.
8.Testingthecolorsoftheerrormessages,warningmessages.
9.Testingwhethertheimagehasgoodclarityornot.
10.Testingthealignmentoftheimages.
http://www.guru99.com/guitesting.html

4/7

7/29/2016

CompleteGuideforGUITesting

11.Testingofthespelling.
12.Theusermustnotgetfrustratedwhileusingthesysteminterface.
13.Testingwhethertheinterfaceisattractiveornot.
14.Testingofthescrollbarsaccordingtothesizeofthepageifany.
15.Testingofthedisabledfieldsifany.
16.Testingofthesizeoftheimages.
17.Testingoftheheadingswhetheritisproperlyalignedornot.
18.Testingofthecolorofthehyperlink.

Demo:HowtoconductGUITest
Herewewillusesomesampletestcasesforthefollowingscreen.

FollowingbelowaretheexampleoftheTestcases,whichconsistsofUIandUsabilitytestscenarios.
TC01Verifythatthetextboxwiththelabel"SourceFolder"isalignedproperly.
TC02Verifythatthetextboxwiththelabel"Package"isalignedproperly.
TC03Verifythatlabelwiththename"Browse"isabuttonwhichislocatedattheendofTextBoxwiththe
name"SourceFolder."
TC04Verifythatlabelwiththename"Browse"isabuttonwhichislocatedattheendofTextBoxwiththe
http://www.guru99.com/guitesting.html

5/7

7/29/2016

CompleteGuideforGUITesting

name"Package."
TC05Verifythatthetextboxwiththelabel"Name"isalignedproperly.
TC06Verifythatthelabel"Modifiers"consistsof4radiobuttonswiththenamepublic,default,private,
protected.
TC07Verifythatthelabel"Modifiers"consistsof4radiobuttonswhicharealignedproperlyinarow.
TC08Verifythatthelabel"Superclass"underthelabel"Modifiers"consistsofadropdownwhichmust
beproperaligned.
TC09Verifythatthelabel"Superclass"consistsofabuttonwiththelabel"Browse"onitwhichmustbe
properlyaligned.
TC10Verifythatclickingonanyradiobuttonthedefaultmousepointermustbechangedtohandmouse
pointer.
TC11Verifythatusermustnotbeabletotypeinthedropdownof"Superclass."
TC12Verifythattheremustbeapropererrorgeneratedifsomethinghasbeenmistakenlychosen.
TC13VerifythattheerrormustbegeneratedintheREDcolorwhereveritisnecessary.
TC14Verifythatproperlabelsmustbeusedintheerrormessages.
TC15Verifythatthesingleradiobuttonsmustbeselectedbydefaulteverytime.
TC16VerifythattheTABbuttonmustbeworkproperlywhilejumpingonotherfieldnexttoprevious.
TC17Verifythatallthepagesmustcontainthepropertitle.
TC18Verifythatthepagetextmustbeproperaligned.
TC19Verifythatafterupdatinganyfieldaproperconfirmationmessagemustbedisplayed.
TC20Verifythatonly1radiobuttonmustbeselectedandmorethansinglecheckboxesmaybeselected.

ChallengesinGUITesting
ThemostcommonproblemcomeswhiledoingregressiontestingisthattheapplicationGUIchanges
frequently.Itisverydifficulttotestandidentifywhetheritisanissueorenhancement.Theproblem
manifestswhenyoudon'thaveanydocumentsregardingGUIchanges.
Conclusion:
SuccessofasoftwareproductimmenselydependsonhowtheGUIinteractswiththeuserandeaseinusing
itsvariousfeatures.Hence,GUItestingisveryimportant.ManualGUItestingcansometimesberepetitive
andboringandhenceerrorprone.AutomationishighlyrecommendedforGUItesting.
ThisarticleismadepossiblebythecontributionsofSwatiGhildiyal,PrateekChandraandGuru99.
YouMightLike
http://www.guru99.com/guitesting.html

6/7

7/29/2016

http://www.guru99.com/guitesting.html

CompleteGuideforGUITesting

7/7

You might also like