0

I have to do JSON web services automation. Can you suggest what is the best approach for this scenario. Every think I tried to depict on image.

enter image description here

Can you please let me know what are the best tools for this.

Thanks

tim_yates
  • 167,322
  • 27
  • 342
  • 338
user2285608
  • 45
  • 3
  • 12

1 Answers1

0

Really depends on the tools you have at your disposal, but here are some options:

1) Write your own client (perl script, c#, whatever) to hit the two REST web services individually, then compare the responses.

2) Use curl.exe or some other pre-built utility to do the HTTP requests, then write a custom script/program to verify the responses.

3) Use a record-playback HTTP test tool like Visual Studio for Testers (or VS Ultimate) to record the HTTP requests to each webservice, and then compare the responses. (you can write c# or VB code to programatically compare them)

However, if you can assume that if JSON response "B" is correct then JSON response "A" must also be correct, you might use that assumption to just verify B and skip A (more of an end-to-end test). In this case you can drive the website or iPad app directly in order to test the web services.

canhazbits
  • 1,664
  • 1
  • 14
  • 19
  • Thanks for yoru inputs..I am using JAVA technolgoies.. Can any one suggest by using Java related stuff ? – user2285608 May 02 '13 at 08:35
  • Options #1 or #2 will still work in Java. See here for how to do an HTTP request using Java: http://stackoverflow.com/questions/1485708/how-do-i-do-a-http-get-in-java – canhazbits May 02 '13 at 18:13
  • Hi Canhazbits, Thanks for your inputs..From testing perspective I no need to touch any thing for Rest http requests.. Just I have to compare A and B responses.. I have one url for A and another url request for B.... the response values are coming on JSON format... So those values I have to compare.Response B {"inventory":{"products":[{"productId":"21000091","skus":[{"productId":"21000091210063421","quantity":"30000.0"},{"productId":"21000091210063520","quantity":"30000.0"} And Response A – user2285608 May 03 '13 at 12:16
  • Response A of course these values are coming on url format..just for info I am pasting...{ "InventoryAvailability": [ { "partNumber": "21000091", "skus": [ { "availableQuantity": "30000.0", "inventoryStatus": "In-Stock", "partNumber": "21000091210063421" }, { "availableQuantity": "30000.0", "inventoryStatus": "In-Stock", "partNumber": "21000091210063520" }, { "availableQuantity": "30000.0", "inventoryStatus": "In-Stock", "partNumber": "21000091210063223" }, – user2285608 May 03 '13 at 12:17
  • Here values should be same ...nodes are changing... like product id, PartNumber and quantity, availableQuantity – user2285608 May 03 '13 at 12:20
  • Example urls ... like this..these will not work..for example Response A http://wcs.net/v1/inventory/21000091,parent1234 Response B http://d.apigee.net/v1/inven/21000091 – user2285608 May 03 '13 at 12:26
  • Is the problem resolved or you are still working on it? Have you tried soapUI and comparing the responses. Also, could you edit your question to add the responses from A and B? – Abhishek Asthana Aug 30 '13 at 16:05