HomeOATS

Web Services testing using Oracle Application Testing Suite – OATS

Like Tweet Pin it Share Share Email

Oracle Application Testing Suite ( a.ka. OATS ) has very user-friendly way of testing  Web Services, in this article you will learn how to create a Web Services test script using Openscript IDE of OATS.

Just to let  you know, web services testing is one of the most hot topic around the globe, due to the pace at which cloud applications, mobile applications are emerging in to the market, the necessity of integrating them has also increased multi fold. Especially the cases of integrations between multiple Enterprise applications or mobile applications for the cloud applications, web services play a major role and needs to be tested thoroughly.

Lets see how we can create a simple web services testing script using Oracle Application Testing Suite ( OATS )

First thing is, you should have brief understanding about a web service and a wsdl  before going in to testing of a web service.

In this article we are using a sample wsdl http://www.webservicex.com/globalweather.asmx?wsdl which is publicly available for testing web services.

Step by Step Instructions to create a web services testing script using OATS / Oracle Application Testing Suite:

  1. Open OpenScript IDE or Oracle Application Testing Suite.
  2. Click New Button.
    01_New_OATS_Script
  3. Select “Web Services” as project type and click Next Button
    02_Select_WS_Project
  4. Give script name of your choice and click Finish.
    03_Openscript_Give_FileName
  5. Once the script tab is ready to use, In the WSDL Manager View of Openscript IDE, click on New Icon.
    04_Add_New_WSDL
  6. Give the sample wsdl file url in the Parse WSDL Dialog window and click on Next Button.
    06_Give_WSDL_For_Parsing
  7. OpenScript IDE lists out all the services and methods present in each service in a tree format, click on Finish Button.
    07_Parsed_WSDL
  8. Expand the url in the “WSDL Manager” view to the desired method you want to test.
    08_Expand_WS_Services_Methods
  9. Right click on the method and click on “Add to script” context menu item.
    09_Add_Method_To_Script
  10. WS script code gets added to the script automatically.
  11. In the “Tree View” expand the step group till we see the “XML Post Data” Node and double click to open the “Post Data” dialog window.
    10_Double_Click_XML_POST_DATA_Node
  12. Expand the Method Node in the Post Data Dialog window to see the list of input parameters to submit the request
  13. Give desired country name for the parameter and “Click OK” , for example: “India” and click “OK” button.
    11_Post_Data_Node
  14. Save the updated script and click on “PlayBack” icon of Openscript and observe “Console”/”Results” view to see the completion of script execution.
    13_Save_Click_Playback
  15. Once the script execution is complete, expand the results view to see more details.
    14_01_Results_Passed
  16. In order to see the response response of the submitted web service request, click on the url in the results section, you will be able to see the complete response returned by this script execution.
    14_02_Response_Submitted_Request

The response could be stored in a string and using XML reader utilities, you can write some programming logic to validate if expected response and actual response are matching.

Please do leave queries through comments, I would be more than happy to help.

Comments (32)

  • Great Post Srinivas !!
    I am really happy to see dedicated posts and web pages on OATS .
    People still not aware of the OATS potential and how easily and quickly we can use OATS to automate web services and other application automation.
    I would be happy to share come contains on OATS which i have created on my own for my team learning.

    Happy Learning.

    Reply
    • Author

      Thank you Saurabh, for liking the content.
      It would be great if you can start using this platform and share your knowledge 🙂 that’s a great value addition.

      Reply
  • Thank you so much Srinivas.
    I have one small question. How i will capture the response data? I tried using http.solve(). It works for a single node but if i am trying to get child node then getting error message.

    http.solve(“dispatchId”, “(.+?)”, “”, false, Source.Html,0, EncodeOptions.None); ——Working

    http.solve(“dispatchId”, “(.+?)”, “”, false, Source.Html,0, EncodeOptions.None)– Not working

    Reply
    • Author

      There is a statement in http module which can help you get the last response content, you may have to work on that output, first to convert to xml file format and then use some XML readers / parser (s) to navigate through different child objects.

       
      // the method to use is
      String lastResponse = http.getLastResponseContents();
      

      There are similar other methods under http you may want to explore them to get going on different requirements, hope it helps you out.

      Please do let me know if that doesnt give you a lead as how to progress.

      Reply
  • String lastResponse = http.getLastResponseContents(); — This line capturing all the response content. However if we want to capture the Response time sec from the results (step:15 (0.555)). How to capture this response time from the test results ?

    Reply
    • Author

      I am not sure if there is a direct way to do it, let me get back to you on that, but just an alternative is , you can capture date and time just before the post statement of web services in the script and one after it, we can program to find the difference and get the actual response time it has taken for the same.

      Reply
  • How to open the IE in New private window with OATS ?

    My application is working only if we open the IE in new private window and hence i would like to follow the same with OATS.

    Can you please help me on this ?

    Reply
    • Author

      Hey Murali,

      Sorry for the delay in response, I was in Oracle Open World 2016 @San Francisco, the time you posted this question.

      Anyways,
      1. In case the issue is not yet resolved, could you please let me know what do you mean by launching IE browser privately?
      2. In case the issue is resolved, it would be great if you can let us know what you did 🙂 that will be helpful for all the readers.

      Reply
  • Hi Srinivas,

    Great to see an active discussion thread on OATS. I am myself implementing OATS toolset at various client sites and in this regards have couple of quick questions. Will appreciate if you can respond to the same:

    1) Can OATS be used to test REST APIs/Web Services
    2) Can OATS be used to automate functional regression testing of Oracle Cloud applications. For on-premise it works great, but for Cloud deployments I am told by Oracle that they do not allow automation. Is it true and outside of OATS do you know of any other automation framework that can be used to automate functional testing for pure cloud deployment.

    Thanks
    Navneet

    Reply
    • Author

      HI Navneet,

      Am glad you liked the discussions happening around OATS, yes I have been putting my view points actively and responding to people and helping them provide some solutions.

      Well coming to your question, to be straight OATS can test web services as mentioned in the blog but if you are looking for REST FULL, there is no straight way to do it, like it has for Web Services.

      But said that, as OATS is built on JAVA, as you must be aware we can execute REST FULL services using JAVA, the same could be called in OATS too 🙂

      And regarding testing Oracle Cloud Applications, as per ORACLE we are not supposed to automate especially on Load Testing, and there are some other discussions happening inside ORACLE 🙂 which I cannot disclose.

      I see that you have been implementing OATS in many client sites, just curious to know which company you work for?, you need not reply over here but can write to testingtools.co@gmail.com and we can exchange contact numbers and discuss 🙂 Hope it works fine for you.

      Reply
  • Hi

    My wsdl is failed to load with exit code 502. How do I set values for WSS-Password Type and WSS-Timetolive in openscript ?

    Thanks
    Advait

    Reply
  • Yes I can come on a screen share . Can you please provide a detail how to share a screen to you ?

    I have tried All parser options and also removed password settings . But it dint work for me.

    Thanks

    Reply
    • Author

      I hope your issue is resolved Advait, in case it is resolved, please do share the steps that you followed to get it resolved. It will help others if the similar kind of issue is being faced by them

      Reply
  • Hi Srinivas,

    I am facing the following issue while doing testing for web services.
    stage.cisco.com/remedy/service/arservice/remedyintegration/get/incident/details/INC800006393433
    Validating https://wsgx-stage.cisco.com/remedy/service/arservice/remedyintegration/get/incident/details/INC800006393433
    Validating https://wsgx-stage.cisco.com/remedy/service/arservice/remedyintegration/get/incident/details/INC800006393433 failed:
    Failed to load url. Make sure you can visit the internet and the proxy settings is correct if it needs.Response error code:415

    What can be the solution for this?
    Can you please help me out with this soon.

    Thanks in advance

    Reply
  • Hi,
    I am using OATS to test REST api, I want to Parse the json object for that I have downloaded the “org.json” jar from “https://mvnrepository.com/artifact/org.json/json/20160810” But, when I ADD this jar unser script’s ASSET in my openscript script and save. Now, when I write -> import org.json.simple.JSONArray;
    I get “The import org.json can nto be reolved”.
    could you please help me out ?

    Reply
    • Author

      Which version of OATS are u using??? I saw this quite prominently when working with earlier versions of OATS, but later it became more stable, It was a bug on OATS. When I was working in ORACLE, we raised this bug and in later versions it got better.

      Let me know which version of OATS are you using?

      Reply
  • Hello Srinivas P,

    First of all, I want to thank you for this post.
    It’s a great job.
    I am new to OATS and I have gone through this article and your YouTube videos (testingtools.co).
    I got stuck here –
    In WSDL Selection page I have given the WSDL URL (http://www.webservicex.com/globalweather.asmx?wsdl) and I am getting the following message after clicking on Next Button.

    Parsing specified wsdl…
    Connecting to http://www.webservicex.com/globalweather.asmx?wsdl
    Validating http://www.webservicex.com/globalweather.asmx?wsdl
    Validating http://www.webservicex.com/globalweather.asmx?wsdl failed:
    Failed to load url. Make sure you can visit the internet and the proxy settings is correct if it needs.Response error code:503.

    Can you please help me out here!!

    Thank You,
    Mahesh

    Reply
    • Author

      Thank you so much…

      Were you able to execute the same using other tools like SOAP or something? if it works fine in SOAP it should ideally work in OATS as well, kindly share your experience and results

      Reply
  • Hello Srinivas,

    I am trying to perform web service functional automation using OATS. I am testing for SOAP api . When I am trying to playback my script , getting the following error :
    “The server name could not be resolved.
    Comparable WinInet error code: Error 12007: ERROR_INTERNET_NAME_NOT_RESOLVED. ”

    Can you please help me out?

    Reply
    • Author

      Hi Heena,
      Thank you for reaching out to us on this issue, just to understand can you tell me if you were able to test the same API using SOAPUI ? sometimes issue might be because of proxy or something.
      So more details can help to resolve.

      Thank You,
      Srinivas P.

      Reply
  • Hi Srinivas,

    I’m running OATS 13.3.0.1.0 build 256 version and I have requirement to load test Oracle BI Publisher API’s. So the questions is, Is OATS compatible for API testing (not Web Services)?

    Thanks,
    Manoj

    Reply

Leave a Reply to Advait Cancel reply

Your email address will not be published. Required fields are marked *