Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Testing web services

33,290 views

Published on

Testing web services is very important part of integration testing on web projects.
In this presentation you can learn the best approaches, tools and features of Web Services testing. Soon I'll share url with a video from my presentation.

Published in: Technology
  • Nice article.. However if the requirement is just to test webservice and you do not want to use fancy SoapUI functionalities, try Postman. There are few other SoapUI alternative application as well...I came across this article on 5 SoapUI alternatives - http://techonestop.com/soapui-alternative-for-webservice-testing
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Testing web services

  1. 1. Testing web services
  2. 2. About Me
  3. 3. Taras Lytvyntesters.lviv.ua/automationtlytvyn@lohika.com
  4. 4. Prehistory
  5. 5. Service = web interface +Web service on Java + DB usage
  6. 6. SERVICE AS STATE MACHINE
  7. 7. Google services
  8. 8. Web Services
  9. 9. What is web service ? QA point of view
  10. 10. Examples
  11. 11. You can find web services in Network tab
  12. 12. Classification
  13. 13. RES SOAP T
  14. 14. 1. Give every “thing” an ID REST 2. Link things together 3. Use standard methodsRepresentational 4. Resources can have multiple State Transfer representations 5. Communicate independently
  15. 15. 1. Use WSDL for description SOAP 2. SOAP is approach of protocols and standardsSimple Object 3. Works with operationsAccess Protocol
  16. 16. WSDL Web Services Description Language is an XML-basedinterface description language that is used for describing thefunctionality offered by a web service.
  17. 17. Request methods
  18. 18. Content Type on response
  19. 19. So what to test ?
  20. 20. Response Correctnessdata data data fullness type order
  21. 21. What else ?
  22. 22. • client part that uses this service• http statuses• authorization• response timeout• load testing• security testing• NEGATIVE cases !
  23. 23. REAL EXAMPLEGEThttp://maps.googleapis.com/maps/api/elevation/json?locations=39.7391536, -104.9847034|36.455556, -116.866667&sensor=true Valid HTTP status code – 200 OK Response timeout !>= 0.5 s Negative cases (check status): - incorrect locations - incorrect sensor value
  24. 24. { "results": [ { "elevation": 1608.637939453125, "location": { "lat": 39.7391536, "lng": -104.9847034 }, "resolution": 4.771975994110107 }, { "elevation": -50.78903579711914, "location": { "lat": 36.455556, "lng": -116.866667 }, "resolution": 19.08790397644043 } ], "status": "OK"}
  25. 25. <Response xmlns="http://maps.googleapis.com/maps/api/elevation/json"> <results> <e> <elevation>1608.637939453125</elevation> <location> <lat>39.7391536</lat> <lng>-104.9847034</lng> </location> <resolution>4.771975994110107</resolution> </e> <e> <elevation>-50.78903579711914</elevation> <location> <lat>36.455556</lat> <lng>-116.866667</lng> </location> <resolution>19.08790397644043</resolution> </e> </results> <status>OK</status></Response>
  26. 26. So how to test ?
  27. 27. TEST WITH: Service Mocks Parsing - xpaths - regexps Manually Automation !!!
  28. 28. Testing features...
  29. 29. PROBLEMS:- SERVICE DOCUMENTATION- DBC- “DYNAMIC” RESPONSE PROBLEM
  30. 30. SERVICE DOCUMENTATIONDOC. example
  31. 31. DATA BASE Connectionfor reading data
  32. 32. “Dynamic” response
  33. 33. Tools
  34. 34. EXAMPLE:rem curl -i -H "Content-Type: application/json" -X POST -d"11032480" http://172.22.40.73:8080/gift-registry/registry-products/5017a4d3ee12d093a5794968/delete
  35. 35. Manual testing
  36. 36. SOAP UI- Support different service standards- Service mocking- Groovy & Java API- Ability of Security and Load Service Testing- Logging results- Maven plugin +- Could be easily integrated to CI- Eclipse Plugin- Test Suite could executed with JUnit
  37. 37. SOAP UI PROJECT SAMPLE
  38. 38. REAL EXAMPLEGEThttp://maps.googleapis.com/maps/api/elevation/json?locations=39.7391536, -104.9847034|36.455556, -116.866667&sensor=true Valid HTTP status code – 200 OK Response timeout !>= 0.5 s Response correctness
  39. 39. SOAP UI TESTING VIDEO CLICK TO WATCH VIDEO ON YOUTUBE
  40. 40. Response parsing approach
  41. 41. JSON Object Library
  42. 42. JACKSONJSON LIBRARY
  43. 43. { "results": [ { "elevation": 1608.637939453125, "location": { "lat": 39.7391536, "lng": -104.9847034 }, "resolution": 4.771975994110107 }, { "elevation": -50.78903579711914, "location": { "lat": 36.455556, "lng": -116.866667 }, "resolution": 19.08790397644043 } ], "status": "OK"}
  44. 44. fill levelsCorrect
  45. 45. ConclusionSUCCESSFUL WEB SERVICE TESTING = SOAP UI + ECLIPSE + JAVA +JACKSON + SOAP UI JAVA API
  46. 46. resolve all needs, approaches andproblems described earlier
  47. 47. Thank you !

×