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:
- Open OpenScript IDE or Oracle Application Testing Suite.
- Click New Button.
- Select “Web Services” as project type and click Next Button
- Give script name of your choice and click Finish.
- Once the script tab is ready to use, In the WSDL Manager View of Openscript IDE, click on New Icon.
- Give the sample wsdl file url in the Parse WSDL Dialog window and click on Next Button.
- OpenScript IDE lists out all the services and methods present in each service in a tree format, click on Finish Button.
- Expand the url in the “WSDL Manager” view to the desired method you want to test.
- Right click on the method and click on “Add to script” context menu item.
- WS script code gets added to the script automatically.
- 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.
- Expand the Method Node in the Post Data Dialog window to see the list of input parameters to submit the request
- Give desired country name for the parameter and “Click OK” , for example: “India” and click “OK” button.
- Save the updated script and click on “PlayBack” icon of Openscript and observe “Console”/”Results” view to see the completion of script execution.
- Once the script execution is complete, expand the results view to see more details.
- 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.
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.
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.
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.
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
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.
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.
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 ?
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.
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 ?
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.
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
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.
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
Hi Advait,
I am happy to help you on this, but may I know what are the steps that you performed to create the script, did you also try executing them using SoapUI? did you give any authentication details when executing through SoapUI ? If so have you given them when working with OpenScript for Web Services project and if you have provided may I know where and how you have provided those details? this can give some details to understand and diagnose the issue.
Thanks,
Srinivas P.
Hi Srinivas,
As you have explained above , I have entered my wsdl link (Step 6) . While clicking on Next it is showing below error
Parsing specified wsdl…
Connecting to http://msp00bcx.us.oracle.com:7067/igs-ASNInPublishing-AppServiceDecorator/ProxyService/ASNInPublishingAppServiceProxy?wsdl
Validating http://msp00bcx.us.oracle.com:7067/igs-ASNInPublishing-AppServiceDecorator/ProxyService/ASNInPublishingAppServiceProxy?wsdl
Validating http://msp00bcx.us.oracle.com:7067/igs-ASNInPublishing-AppServiceDecorator/ProxyService/ASNInPublishingAppServiceProxy?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:502
This wsdl is working fine without any authentication (username / password) in SOAPUI.
and other wsdl for which I am using authentication in SOAPUI , I am giving authentication detail in preferences — > HTTP –> Proxy settings –> Proxy Authentication in open script.
Will you be able to come on a screen share?
I would request you to give a try by doing following things :
Remove the password settings and try once the same steps, see if you can proceed from step 6. Also, in the 6th step there is a parser option which you can select, can you try with other options too once and let me know your findings.
Other way is, take the payload which you used in SoapUI to execute and store it in some txt file or any other file and then use the WebService API as ws.post(….) , before calling this api read the content from external file as a string and then store in a string variable, this string variable can be passed to the API call, ws.post(…. ) please check and let me know if it worked this way or not.
Thanks,
Srinivas P.
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
You could use Team Viewer
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
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
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
Did you try accessing the url directly in browser? please check if its giving some output… one of the reasons could be that you need to add url to host, but you need to know the ip address as well,otherwise you will not be able to access.
I see that you are unable to access the url, If that is the case I would recommend you to go through the 4 simple steps based tip to configure and be able to access the same. Please do let us know if this worked out for you.
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 ?
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?
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
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
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?
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.
Hi Srinivas ,
Yes, I am able to test the same API using SOAPUI.
Thanks
are you still facing the issue?
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
Yes, automating of APIs should be possible in OATS.