Introducing Web Testing Using VSTS

learn VSTS testing
of 9
All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.
Related Documents
  IntroducingMicrosoft Visual Studio 2005Team System Web Testing Acknowledgment This article is based upon articles written by Mark Michaelis and Josh Christie in MSDN.  Introducing Microsot !isual Studio ##$ Team System %eb Testing 2 Contents ã Introduction ã &ecording a %eb Test ã 'sing the %eb Test !iewer to !eriy a %eb Test ã (inding Test Data to a Data Source ã )enerating %eb Test Code ã *+tending !STS %eb Testing ã Debugging Common %eb Test ,roblems ã Conclusions Introduction  This article pro-ides an o-er-iew o testing web application unctionality using !STS. It begins by pro-iding astepbystep approach on how to set up a %eb test case and customi/e it without writing any code. This articledemonstrates an approachability o !STS %eb Testing by all those participating in the de-elopment process0including nonde-eloper types. %eb test cases can easily be coded as well0 and we will describe how to usecoded %eb tests or e+tend the builtin %eb testing support. (eore we begin0 readers should be aware that !STS unctionality is not targeted at testing the user interace. Itdoesn1t run Ja-aScript in a webpage or -alidate the appearance o a page within multiple browsers. &ather0 thetesting approach is to e+amine 2TT, data 3owing o-er the wire and pro-ide -arious rules or -alidating thisdata. Process Of Web Testing 4igure 5 Recording a Web Test !STS %eb Testing supports acti-ity recording0 as long as there e+ists a website to record against. To recordacti-ities o a web application0 we can create a new test pro6ect or use an e+isting one. Adding a web test caseis more speci7c to web testing. %hen it is added0 an acti-ity recorder is started in which we can browse the webapplication like browsing through a normal browser.8n the address bar0 we can enter the '&9 o the personal website0 including the port selected by the AS,.N*TDe-elopment Ser-er. (rowsing to this location will be recorded in the %eb Test &ecorder e+plorer bar: as wouldany other '&9s that are entered. 8nce the desired tests ha-e been recorded0 we can close the browser windowsand sa-e the test. The pro6ect will automatically include the %eb test case 7le along with each o the recordedre;uests. Recording with Think Time in Mind  The ThinkTime property on a %eb test re;uest reers to the amount o time a user spends <thinking< on thecurrent page beore issuing the ne+t re;uest. Think time delays are used to appro+imate real user beha-iorduring a load test. (ecause think time can dramatically a=ect the amount o load a %eb test can generate0 itcan be globally disabled in a load test to apply greater load to a target ser-er. Disabling ThinkTime allows youto issue re;uests to the ser-er as ast as possible without delay between re;uests. The %eb test recorder automatically records think time at the same time that re;uests to the %eb applicationare recorded. During recording0 try to appro+imate the amount o time a user would normally spend on eachpage. 8nce the recording is complete0 it is -ery important to check the recorded think time or each re;uest.  Introducing Microsot !isual Studio ##$ Team System %eb Testing 3 Inad-ertently long ThinkTimes can dramatically a=ect the rate at which a %eb test generates re;uests. ThinkTimes are turned o= by deault in the %eb test -iewer. As a result0 long ThinkTimes might not beimmediately apparent. %hen ThinkTimes are turned on in the %eb test -iewer0 you will see <Thinking>?n@<displayed in the 2TT, Status column until the ne+t re;uest begins. ThinkTimes are turned on by deault in loadtests. The ThinkTime counter is paused when recording is paused and while entering a comment. Inserting Comments Inserting comments during the recording can be a helpul aid or creating an e=ecti-e %eb test0 especiallywhen the %eb test contains many re;uests. ou should use comments to make notes about what logical actionis about to take place at di=erent points in the %eb test such as <9ogging in0< <Adding item B to the shoppingcart0< and so on. These comments can be -ery helpul when you later modiy the %eb test in the %eb testeditor.  ou can also use comments to make notes about -alidation rules you need to add to ensure the %eb test issuccessul. It is much easier to decide what needs to be -alidated on each re;uest while recording and lookingat the pages than when looking at a list o 2TT, re;uests in the %eb test editor. Customization Selecting any o the nodes within the %ebTest tree will allow you to modiy the data inside the ,ropertieswindow. ou can also group re;uests together using a transaction. (e careul not to conuse the term <transaction< witha programming concept in which state is committed or not committed as a unit. %ithin %eb test cases0transactions only encapsulate actions into a group that can later be enumerated using code. Also0 transactionsare used when reporting on loadhow many transactions per second0 or e+ample. Using the Web Test Viewer to Verify a Web Test (eore adding a %eb test to a load test0 and running it or a long period o time0 it is important to be sure thatthe test works e+actly as intended. This is where the %eb test -iewer comes in to consideration. The %eb test-iewer allows you to watch a %eb test as it runs0 and to -iew all aspects o a pre-ious test run.  Introducing Microsot !isual Studio ##$ Team System %eb Testing 4 4igure !eriying a newlycreated %eb test goes beyond looking at the outcome o the test run and seeing whether itpassed. 4or e+ample0 or a %eb test without -alidation rules passed0 means that no e+ceptions were thrown0 norules ailed0 and no 2TT, errors occurred. !eri7cation includes making sure the %eb test e+hibits the correctbeha-ior on the target %eb application0 in addition to e+ecuting without any errors. It is important to re-iew theresponse or each re;uest to make sure that it is correct. Running a Web Test Case Ater recording a test you are ready to begin e+ecuting it. To e+ecute all the tests within a pro6ect0 simply runthe pro6ect. This will open up the Test &esults windows and mark each test as pending while it is in progress0and ,assed4ailed once e+ecution completes. Test selection and e+ecution is also a-ailable rom the TestManager and Test !iew windows.Indi-idual %eb test 7les Etest cases or test 7+turesF can also be run by opening them up and clicking the &unbutton. &e;uests can also pro-ide credentials or logging on to the targeted site using standard authenticationmethods. The dialogs or credentials allow or loading the login data rom a data source.*ach result rom a re;uest is sa-ed0 and selecting each re;uest allows you to na-igate its detail0 -iewing theresulting page1s 2TM9 or raw re;uestresponse te+t.As part o a test e+ecution0 the %eb test engine -eri7es i all the '&9s on the page are -alid links. These linksappear as child nodes below the re;uest show the 2TT, status returned by a re;uest to each o the '&9s. Reuest Ru!es Although checking or -alid hyperlinks on a response page is a useul eature0 it is not suGcient in -alidatingthat the page is unctioning correctly. 4or e+ample0 on entering -alid credentials0 the %eb test needs to -eriythat the login was successul. Similarly0 when the credentials are in-alid0 you need to check that an appropriateerror message is displayed on the page. To support this0 each %eb re;uest can include e+traction rules and-alidation rules.

Science T1.docx

Jul 23, 2017


Jul 23, 2017
Related Search
We Need Your Support
Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

Thanks to everyone for your continued support.

No, Thanks