SoapUI interview Questions

SOAP UI INTERVIEW QUESTIONS SET-1

Question: 1
Explain what is SOAP UI?
Answer:
SOAP UI is a free, open source cross-platform functional testing solution. It enables you to rapidly and easily create and execute automated regression, compliance, functional and load tests.

Question: 2
What are webservices?
Answer:
Web services are web components that transfer data between client and server. Client sends a web request to the server and the server then responds to client. The response and request are related and different requests evoke the corresponding response.
Web Service is a web component or software program that can be accessed on the Internet. It is mainly used to communicate with the web based applications through XML messaging concepts. For example, if we want to access a particular location using Google Maps, we can use the corresponding web service URL. For that we have to pass the appropriate inputs.

Question: 3
Can custom code be added to SoapUI? If yes, what can be added?
Answer:
Yes -Groovy steps and Javascript steps.

Question: 4
Does SoapUI support SSL Authentication
Answer:
Yes

Question: 5
What is the primary challenge when testing webservices?
Answer:
Majority of the functional testing is carried out via the GUI; the biggest challenge of webservices is that they do not have a UI.

Question: 6
Explain what is the role of XML, SOAP, WSDL and UDDI in web services?
Answer:
Web services are a medium through which web based application can be integrated or communicated over an internet protocol backbone. Web based application can be integrated using XML, SOAP, UDDI and WSDL. SOAP is used for transmitting the data; WSDL is used for describing or relating the services, UDDI is used for listing what services are accessible, XML is used to tag the data.

Question: 7
What is Groovy script and where can it be used?
Answer:
Groovy is a scripting language which internally includes all the java libraries – it helps us to customize and add custom validations to SoapUI tests

Question: 8
Inside the SOAPUI where groovy script can be used?
Answer:
Inside the SOAPUI groovy script can be used in two places

-Groovy script test step
-Script Assertion- within test step

Question: 9
What are the communication channels available for a web service?
Answer:
In general, web service is combined with the following protocols. They are,

  • HTTP / POST
  • HTTP / GET
  • SOAP

While exposing the web services, these channels will be used for communication with the clients. Here HTTP / POST protocol transfers the information between the clients with secure mode. HTTP / GET protocol allows the clients to view transferred data partially at the browser’s address bar. SOAP is used for transferring the confidential data safely.

Question: 10
Mention what SoapUI can do?
Answer:
SoapUI can-

  • It can do automated testing like load tests, scenario-based tests and data driven tests
  • It has got built-in reporting abilities
  • It has got unique ability to impersonate web services and run functional and load test against them even before they are executed

Question: 11
Explain about XPath Assertion in SoapUI
Answer:
In SoapUI, XPath assertion is used for asserting the web service response value by specifying the absolute path. If the absolute path is matched with the response value, then the test case or test suite will be considered as PASS otherwise it will be notified as FAILED. We can see the results of assertion at bottom of the screen where the Assertion tab will have resultant information.

Question: 12
Mention what is the general format for reading the custom or default property value?
Answer:
The general format for reading the custom or default property value is ${#levelname#key}

Question: 13
What are the different components can be used in the web services?
Answer:
There are four components are used in web services. They are,

  1. WSDL – Web Service Description Language
  2. SOAP – Simple Access Object Protocol
  3. UDDI – Universal Description, Discovery and Integration
  4. RDF – Resource Description Framework
  5. XML – eXtensibleMarkup Language

Question: 14
Mention how SoapUI is used to structure functional tests?
Answer:
SOAP UI uses three levels to structure functional tests

  • TestSuite: It is a pool of test cases used for combining functional tests into logical units
  • TestCase: It is a group of test steps that are bring together to test some specific aspect of your services. You can augment any number of testcases to test suites
  • TestSteps: They are “building blocks” of functional tests in SOAPUI. They together makes TestCase and determines the flow of execution of the service to be tested

Question: 15
What are SoapUI assertions?
Answer:
Assertions compare the parts/all of the response message to the expected outcome.

Question: 16
Explain how you can parameterize the endpoints in SOAP UI?
Answer:
To parameterize the endpoints in SOAP UI is most important as it is the first step in automation testing. It is more time consuming for changing endpoints manually. In order to do that

  • Define a project property holding the endpoint
  • Change the endpoint to use this property via property expansion
  • Ensure that your requests are availing the configured endpoint
  • When a request is run, the property will inevitably be with its current value. To use a different value just configure the endpoint in the UI, you can use the P option from the command line

Question: 17
What are the tools used for testing Web services?
Answer:
To perform functional testing for web services, we can use the following tools.

  • SoapUI
  • RESTClient – This is a Firefox plug-in
  • JMeter – Specially made it for performance testing tool and also we can do functional testing the web services.

Question: 18
Explain what is the properties in SoapUI?
Answer:
Properties in SOAPUI is used to retrieve and store data. The data is stored as key, value or format.

Question: 19
What hierarchy SoapUI follows to build a proper testing project?
Answer:
In a SoapUI project, the following order should be maintained.

  • TestSuite – This is combination of functional tests and logical blocks
  • Testcase – Its a group that contains several test steps for the specific aspects of the service.
  • Teststep – it contains the set of functional tests

Question: 20
Explain where you use properties in SoapUI?
Answer:
We can read the property values into test step endpoint, username, header values, password, domain, POST, PUT, GET and DELETE method properties.

Question: 21

What is the role of WSDL document in web service testing?
Answer:
Validating webservices in only possible with WSDL document because to configure web services in SoapUI, WSDL document is mandatory. If the WSDL document is not valid, SoapUI will throw an exception immediately.

Question: 22
What is meant by Protocols and what are the major types are used in web services?
Answer:

  • A protocol is a set of standard rules that helps to communicate the hardware devices through the software applications. There are different types of protocols used in the Internet and Intranet applications. They are
  • TCP which stands for Transmission Control Protocol. It has the rules to exchange the messages between two different Internet applications.
  • Internet Protocol uses the rules for sending and receiving the information between two different Internet addresses.
  • Similarly, HTTP, FTP and DHCP protocols are used the set of rules to transfer the data other than Internet applications.

Question: 23
What are the advantages of SOAP?
Answer:
Since its XML based, it is platform and programming language independent. RPC (Remote procedure calls) are sometimes blocked by firewalls and proxy servers- Soap overcomes that.

Question: 24
What is SOAP?
Answer:
Simple Object access protocol that uses XML to interact with web applications. It uses XML based content to communicate between two client machines across any network

Question: 25
Explain what is Groovy?
Answer:
Groovy is an object-oriented programming language for JVM (Java Virtual Machines). It is used to combine Java modules, to write Java application and to extend existing Java application.

Question: 26
What are the dependencies for Groovy?
Answer:
As well as Java 1.4 and the Groovy jar we also depend at runtime on the ASM library.

Question: 27
Mention what relational operators is used for in Groovy?
Answer:
Relational operators allows you to compare between objects, to check whether the two objects are different or same or if one is less than, greater than or equal to others.

Question: 28
Things work if I use Suns conventions and put { on the same line, but if I add a new line things break?
Answer:
When using closures with method calls we have some syntax sugar in Groovy which is sensitive to white space (newlines to be precise). Please see this description in common gotchas for a full description.

Question: 29
Why use Groovy?
Answer:

  • For Java programmers it provides familiar syntax
  • It has a rich stock of Java Libraries
  • It easily integrate with your existing infrastructure like Servlet Containers, App Servers, Loads of databases with JDBC drivers,
  • Completely Object Oriented
  • It possesses a reusable and assignable pieces of code
  • Operators can be overloaded
  • Literal declaration for maps, arrays, ranges and regular expressions
  • It has efficient object navigation

Question: 30
What is the licence for Groovy?
Answer:
Groovy is open source using a BSD / Apache style licence

Question: 31
When “propertyMissing (String)” method is called?
Answer:
The “propertyMissing (String)” method is called when no getter method for a given property can be detected by the Groovy runtime.

Question: 32
How can I add stuff to the classpath when running things in groovysh or groovy?
Answer:
You can add things to your $CLASSPATH environment variable. Another popular option is to create a .groovy/lib directory in your home directory and add whatever jars you want to be available by default. e.g. if you wish to connect to your favourite JDBC database and do some scripting with it then add your JDBC driver to ~/.groovy/lib.

Question: 33
What is the limitation of Groovy?
Answer:

  • Groovy can be slower
  • Groovy might need lots of memory
  • Groovy start up time requires improvement
  • It requires Java knowledge
  • It takes sometimes to get use to like New Syntax, closures, default typing,
  • Documentation is thin

Question: 34
I get errors when trying to run groovy, groovysh or groovyConsole. Whats wrong?
Answer:
Groovy depends on JDK 1.4 or later. Common errors people have when trying to run Groovy is that there’s an old groovy jar on the CLASSPATH somewhere (have you checked in java/lib/ext?) or that JAVA_HOME points to an old JDK before JDK 1. For more help please see this description of running Groovy code.

Question: 35
Explain what does the JsonSlurper class indicates?
Answer:
The JsonSlurper is a class that parses JSON text or reader content into Groovy data structures (objects) such as lists, maps, and primitive types like double, Boolean, string and Integer.

Question: 36
Explain how Scripts are run in Groovy?
Answer:
Groovy supports plain script; it does not require a class declaration. At the front of the script, imports are supported at the same way that it can be at the front of a class. In Groovy, you have to use word def to declare a function outside of a class.

Question: 37
Explain the role of Grape dependency in Groovy?
Answer:
Grape is a JAR dependency manager included into Groovy. It allows you to add quickly maven repository dependencies to your classpath, making scripting easier. The simplest use is adding an annotation to your script.

Question: 38
Mention what are some features does Groovy JDK offers?
Answer:
Groovy has added new methods compare to old version like

  • Various array types and object streams with newly Groovy oriented methods like Object.every(), Object.each() etc. and also include new features like “String BufferedReader.getText()” and “InputStream.eachLine(Closure)”.

Question: 39
Explain GroovyDoc comment?
Answer:
Like multiline comments, GroovyDoc comments are multiline but it starts with a /** and end with */. Those comments are related with

  • Type definitions (classes, interfaces, enums, annotations)
  • Fields and properties definitions
  • Methods definitions

Question: 40
Mention what is the role of closure and listeners in Groovy?
Answer:
Groovy does not support anonymous inner classes; it is possible to determine action listeners inline through the means of closures. In Groovy, listeners closure are used as a ListenerAdapter where only one method of interest is overridden.

Question: 41
Explain what is Groovysh?
Answer:
Groovysh is a command line application that enables an easy access to evaluate Groovy expressions, define classes and run experiments.

Question: 42
Explain how you can add stuff to the classpath when running things in groovy or groovysh?
Answer:
You can add things to your $CLASSPATH environment variable. Another possibility is to build a .groovy/lib directory in your home directory and append whatever jars you want to be available by default.

Question: 43
Explain how you can include a groovy script in another groovy?
Answer:
You can include a groovy script with another groovy by using the following code. When put this code at the top of the script it will bring in the contents of a groovy file.
Evaluate(new file(“../tools/Tools.groovy”))

Question: 44
Mention what is the license for Groovy?
Answer:
Groovy depend at runtime on the ASM library as well as Java 1.4 and the Groovy jar.

Question: 45
Explain how Groovy string is expressed?
Answer:
Groovy string is referred as Gstring.

  • It is surrounded by double quotes, for regular strings it uses single quotes
  • It may contain Groovy Expressions noted in ${}
  • Square bracket syntax may be applied like charAt(i)

Question: 46
Explain what is ExpandoMetaClass in Groovy?
Answer:
ExpandoMetaClass is used to add methods, properties, static methods and constructors. Expandoclass does not inherited by default; you have to call ExpandoMetaClass.enableGlobally().

Q #47. What are webservices?
Ans. Web services are web components that transfer data between client and server. Client sends a web request to the server and the server then responds to client. The response and request are related and different requests evoke the corresponding response.
Web Service is a web component or software program that can be accessed on the Internet. It is mainly used to communicate with the web based applications through XML messaging concepts. For example, if we want to access a particular location using Google Maps, we can use the corresponding web service URL. For that we have to pass the appropriate inputs.

Q #48. What is the primary challenge when testing webservices?
Ans. Majority of the functional testing is carried out via the GUI; the biggest challenge of webservices is that they do not have a UI.

Q #49. What are the communication channels available for a web service?
In general, web service is combined with the following protocols. They are,

  • HTTP / POST
  • HTTP / GET
  • SOAP

While exposing the web services, these channels will be used for communication with the clients. Here HTTP / POST protocol transfers the information between the clients with secure mode. HTTP / GET protocol allows the clients to view transferred data partially at the browser’s address bar. SOAP is used for transferring the confidential data safely.

Q #50. What are the different components can be used in the web services?
There are four components are used in web services. They are,

  • WSDL – Web Service Description Language
  • SOAP – Simple Access Object Protocol
  • UDDI – Universal Description, Discovery and Integration
  • RDF – Resource Description Framework
  • XML – eXtensibleMarkup Language

Q #50. What are the different components can be used in the web services?

There are four components are used in web services. They are,

  • WSDL – Web Service Description Language
  • SOAP – Simple Access Object Protocol
  • UDDI – Universal Description, Discovery and Integration
  • RDF – Resource Description Framework
  • XML – eXtensibleMarkup Language

Q #51. What are the tools used for testing Web services?

To perform functional testing for web services, we can use the following tools.

  • SoapUI
  • RESTClient – This is a Firefox plug-in
  • JMeter – Specially made it for performance testing tool and also we can do functional testing the web services.

Q #52. What is WSDL?

Ans. WSDL stands for Web Service Description Language and is a document written in XML. It uses XML to define the service layer document which consists of origin of the web service, headers, port types, request and response data. This one can provide the information about web methods and web service.

It describes:

  • Origin of the web service
  • Header information
  • Port type
  • Input and output messages

Q #53. What is the role of WSDL document in web service testing?

Ans. Validating webservices in only possible with WSDL document because to configure web services in SoapUI, WSDL document is mandatory. If the WSDL document is not valid, SoapUI will throw an exception immediately.

Q #54. What is UDDI?

Ans. Universal Description, Discovery and Integration- a directory or global repository where all the webservices can be found. A new Webservice can also be registered through this. This is also the place where WSDL detailed definitions are found.

It uses the discovery layer which is used in the web services. UDDI has all the information about the web services in detail. Global web services can be deployed at http://uddi.xml.org/

Q #55. What is SOAP?

Ans. Simple Object access protocol that uses XML to interact with web applications. It uses XML based content to communicate between two client machines across any network.
SOAP is a protocol for accessing web services.

  • It is XML based
  • SOAP provides a way to communicate between applications running on different operating systems, with different technologies and programming languages.
  • A SOAP message is an ordinary XML document containing the following elements:
    • An Envelope element that identifies the XML document as a SOAP message
    • A Header element that contains header information
    • A Body element that contains call and response information
    • A Fault element containing errors and status information

Q #56. What would be the message format of SOAP protocol?

Generally, all the SOAP based web services are written by using XML language which uses standard message format that is accepted across the universe. In this format, it is easy to read, identify the errors, avoids interoperability problems etc.

Here’s the sample SOAP message format.

  • POST /InStock HTTP/1.1
  • Host: localhost
  • Content-Type: application/soap+xml; charset=utf-8
  • Content-Length: 399
  • SOAPAction: “http://www.example.com/soap-envelope”

Q #57. What are the advantages of SOAP?

Ans. Since its XML based, it is platform and programming language independent. RPC (Remote procedure calls) are sometimes blocked by firewalls and proxy servers- Soap overcomes that.

Q #58. What does a soap document contain?

Ans. Envelope element is the top most tag which identifies the XML document as a SOAP message. Followed by Envelope element, you see the header element that has header information. The Body element specifies the call and response information. Finally, you have a Fault element which contains errors and status information.

Q #59. What is meant by Protocols and what are the major types are used in web services?

A protocol is a set of standard rules that helps to communicate the hardware devices through the software applications. There are different types of protocols used in the Internet and Intranet applications. They are

TCP which stands for Transmission Control Protocol. It has the rules to exchange the messages between two different Internet applications.

Internet Protocol uses the rules for sending and receiving the information between two different Internet addresses.

Similarly, HTTP, FTP and DHCP protocols are used the set of rules to transfer the data other than Internet applications.

Q #60. What is XML?

Ans. XML (eXtensibleMarkup Language) is a mark-up language that is used for storing, sharing and formatting data. In general, an XML document is built by the tags. For more info and examples, check out this article http://www.softwaretestinghelp.com/web-services-api-testing-tool-soapui-tutorial-1/

Q #61.SoapUI and SoapUI Pro:

Ans. SoapUI is a webservices testing tool and SoapUI Pro is its commercial version. SoapUI can help create functional, security and load testing test suites. SoapUI Pro does all that with advanced drag and drop, data driven testing, advanced reporting and coverage analysis. Check out this article for more information: http://www.softwaretestinghelp.com/soapui-tutorial-12-soapui-pro-features/

Q #62. What we can do with the help of SoapUI?

SoapUI offers us to perform automation testing which includes functional testing, load testing and data driven testing.
It also provides in build reporting tool and export test results log provision
We assert our services using various types of assertions

Q #63. What hierarchy SoapUI follows to build a proper testing project?

In a SoapUI project, the following order should be maintained.

  • TestSuite – This is combination of functional tests and logical blocks
  • Testcase – Its a group that contains several test steps for the specific aspects of the service.
  • Teststep – it contains the set of functional tests

Q #64. What is the basic method to automate web services in SoapUI?

Ans.

  • Create a project and add the WSDL file
  • Add test suites, Test cases and Test cases- in that order
  • Include custom programming/validation using by adding Groovy steps
  • Call external data sources if using
  • Add assertions if necessary
  • Then RUN.

Q #65. What are SoapUI assertions?

Ans. Assertions compare the parts/all of the response message to the expected outcome.

Q #66. What are the major types of assertions available in SoapUI?

Assertions are the one of the major feature in SoapUI. It offers the following types of assertions.

  • Simple contains
  • Schema compliance
  • Simple not contains
  • Soap Faults
  • Response SLA
  • XPath Match
  • XQuery Match
  • WS security status
  • Script Assertion
  • WS- Addressing Request or Response Assertion
  • Additionally Equals assertion is introduced in SoapUI NG Pro version.

Q #67. Explain about XPath Assertion in SoapUI

In SoapUI, XPath assertion is used for asserting the web service response value by specifying the absolute path. If the absolute path is matched with the response value, then the test case or test suite will be considered as PASS otherwise it will be notified as FAILED. We can see the results of assertion at bottom of the screen where the Assertion tab will have resultant information.

Q #68. What is Data Driven testing?

Data driven testing means to store our test data which includes input and expected output in an external data source called Excel / Database / XML file. Later, we need to iterate the data source using respective component. In SoapUI, Datasource and Datasource Loop test steps are used for performing data driven testing.

Q #69. What are the different types of assertions used in SoapUI?

Ans. The following are the different types of assertions:

  • Contains & Not Contains
  • XPath match
  • XQuery match
  • Schema compliance
  • Soap Faults
  • Response SLA
  • WS security Status
  • Script Assertion
  • WS- Addressing Request or Response Assertion

Q #70. How can assertions be added in SoapUI?

Ans. Receive a response to a request as you normally would follow the below steps:

  • Create a project, add WSDL
  • Add Test suite, Test case and Test steps
  • Run the request
  • To add assertions:
    – Click on the Add Assertions at the top of log tabs.
    – Configure the assertions as per the type and data required.

Q #71. What is Groovy script and where can it be used?

Ans. Groovy is a scripting language which internally includes all the java libraries – it helps us to customize and add custom validations to SoapUI tests

Q #72. Can custom code be added to SoapUI? If yes, what can be added?

Ans. Yes -Groovy steps and Javascript steps.

Q #73. How to group tests?

Ans. The basic Test suite is a way for us to group tests in SoapUI. When you need a different set of tests, you just have to create a new test suite and create tests as required under it as test cases.

Q #74. How to save the responses received?

Ans. The response values can be saved by clicking on the required request and choosing the “Dump file” location in its properties.

Q #75. What are the properties available in SoapUI?

In SoapUI, there are three levels of properties available. They are,

  • Custom Properties or Project Level Properties:
  • These properties are added several times based on our needs and they can be utilized at any test suites, test cases or test steps that belongs to the current project.
  • Test Suite Level Properties:
  • Tester can add his own properties with relevant information under the test suites. These properties are available under the corresponding test suite only.
  • Test case Level Properties: If the tester needs to store their test data within the test cases they can create their own properties inside the test case. So these properties can be accessed within the respective test cases.

Q #76. Explain the procedure to parameterize the endpoint in SoapUI?

Parameterizing feature is most important when we automate the test cases and also this is the beginning of the test step creation process. Let us have look into this.

  • Create project which has the endpoint information
  • If necessary, change the endpoint and assign to the property through the property expansion test step
  • Make sure the request information available in the given endpoint address
  • During the execution time, property will hold the test value. Providing different input value to the property it is easy to do it through the IDE.

Q #77. What are the major places that Groovy Script Teststep used?

In SoapUI, we can use Groovy Script in the following two places.

  • Groovy Script Teststep under the test case
  • Script Assertion Test Step

Q #78. Soap vs REST?

Ans.

SOAP is a protocol and REST is architecture. It allows us to send SOAP envelops to REST based applications.

  • REST supports different message formats but SOAP permits XML only.
  • REST services are faster and easy to handle.
  • SOAP is tied with SMTP and HTTP protocols whereas REST relies on HTTP only.
  • SOAP is more secure and structured format.
  • REST does not depend on any specific standards as it supports various messaging formats like JSON, CSV and XML.
  • SOAP web services allow us to build the client with RESTful services.
  • SOAP was introduced for distributed computing.
  • After REST’s entry, it accommodated the web by its performance and scalability as it is a light weight component.
  • REST is stateless whereas SOAP is a state-ful specification.
  • REST uses Uniform Resource Identifier (URI) and it has the methods like GET, PUT, POST and DELETE to expose their resources.
  • SOAP uses named operations and interfaces to achieve its business logics.

Q #79. What is RDF?

Ans. Resource Description Framework- RDF contains the description of the web resources such as title, author, content, and copyright information. It is written using XML. For more info and examples, check out this article http://www.softwaretestinghelp.com/web-services-api-testing-tool-soapui-tutorial-1/

Q #80. What data sources can be used in SoapUI?

Ans.

  • Excel Files
  • CSV Files
  • ODBC Sources
  • SQL / ADO Objects

Q #81. How can I parameterize the test data in soap UI?

Ans.

  • We can use excel (Or)
  • Use test case level properties

This question also relates to the question “What is Data Driven testing?”

Q #82. What are the REST COMMANDS?

Ans.

  • Create => HTTP PUT
  • Retrieve => HTTP GET
  • Update => HTTP POST
  • Delete => HTTP DELETE

Q #83. How do you validate your response?

Ans.

    • Add assertions to validate the data.

For example date format should be mm/dd/yyyy;

We can add assertions and regular expressions

  • Write groovy script to connect to database and retrieve data;
  • compare the data with the response xml

The above question is related to “How can assertions be added in SoapUI”?

Q#84. Difference between REST and SOAP
Ans. SOAP is a protocol for sending/receiving data over HTTP as XML. -REST (Representational State Transfer).It’s a way of designing a web service.

Q#85. What is end point in Web Services?
Ans. It is the IP address of the server where the web services are running

Q#86. How will you do regression testing using soap UI?
Ans. By Creating Test Suite in the SOAP UI we can do regression Testing. We need to keep different assertions for the request coverage, that to confirm that all the expected parameters are coming in the response.

Q#87. What is XML?
Ans. Extensible Markup Language is a uniform data representation and exchange mechanism.

Q#88. What is UDDI?
Ans. Universal Description, Discovery, and Integration specification, UDDI is a mechanism to register and located WS based application.

Q#89. What is WSDL?
Ans. Web Services Description Language, this is a standard Meta language to describe the services offered. Specifically, WSDL states what a request message much contain and what the response will look like in a clear notation. WSDL also defines where the service is available and what communications protocol is used to talk to that service.

Q#90. What types of operations are available in WSDL?
Ans. There are four operations available: 1. One-way, where the operation can receive a message but will not return a response. 2. Request-response, where the operation can receive a request and will return a response. 3. Solicit-response, where the operation can send a request and will wait for a response. 4. Notification, where the operation can send a message but will not wait for a response.

Q#91.Define a REST web service?
Ans. REST is Representational State Transfer and it is a network of web pages where the client progresses through an application by selecting links. REST is an architectural style that uses existing standards such as HTTP.

Q#92. What are web services components? -XML
Ans. SOAP -UDDI -WSDL

Q#93. Can I use GET request instead of PUT to create resources?
Ans. No, you are supposed to use PUT or POST. GET operations should only have view rights.

Q#94. What all tools have you used to write Restful web service?
Ans. SOAPUI

Q#95. What are the different styles of Web Services used for application integration?
Ans. SOAP WS and Restful Web Service

Q#96. How would you decide what style of Web Service to use?
Ans. SOAP WS or REST? In general, a REST based Web service is preferred due to its simplicity, performance, scalability, and support for multiple data formats. SOAP is favored where service requires comprehensive support for security and transactional reliability.
The answer really depends on the functional and non-functional requirements.
Asking the questions listed below will help you choose.

  • Does the service expose data or business logic? (REST is a better choice for exposing data, SOAP WS might be a better choice for logic).
  • Do the consumers and the service providers require a formal contract? (SOAP has a formal contract via WSDL)
  • Do we need to support multiple data formats? Do we need to make AJAX calls? (REST can use the XMLHttpRequest)
  • Is the call synchronous or asynchronous? Is the call stateful or stateless? (REST is suited for stateless CRUD operations)
  • What level of security is required? (SOAP WS has better support for security)
  • What level of transaction support is required? (SOAP WS has better support for transaction management)
  • Do we have limited band width? (SOAP is more verbose)
  • What’s best for the developers who will build clients for the service? (REST is easier to implement, test, and maintain)

Q#97. What tools do you use to test your Web Services?
Ans. Soap UI tool for SOAP WS

Q#98. What is the difference between SOA and a Web service?
Ans. SOA is a software design principle and an architectural pattern for implementing loosely coupled, reusable and coarse grained services. You can implement SOA using any protocols such as HTTP, HTTPS, JMS, SMTP, RMI, IIOP (i.e. EJB uses IIOP), and RPC etc. Messages can be in XML or Data Transfer Objects (DTOs). Web service is an implementation technology and one of the ways to implement SOA. You can build SOA based applications without using Web services For example by using other traditional technologies like Java RMI, EJB, and JMS based messaging, etc. But what Web services offer is the standards based and platform-independent service via HTTP, XML, SOAP, WSDL and UDDI, thus allowing interoperability between heterogeneous technologies such as J2EE and .NET.

Q#99. What types of testing can you perform using SOAP UI?
Ans. Soap UI allows you to easily and rapidly create and execute automated functional, regression, compliance, and load tests.

Q#100. What is Data-Driven testing? How can you do this using SOAP UI?
Ans. Data-driven testing is when you store test data (input, expected output, etc) in some external storage (database, spreadsheet, xml-files, etc) and then use that data iteratively in your tests when running them. For example to test your phone-lookup service, you might have a list of names and expected phone-numbers in a database which you would use to “drive” your test, checking that each name gets the right phone-number back. It’s really quite simple.

Q#101. Which version of SOAP UI Pro are you using?
Ans. Mention the latest version

Q#102. How to add an Assertion to the test?

    • Open the request editor.
    • In the request editor, click the Add an Assertion to Test Request button.
    • Select Response SLA from the drop down in the Select Assertion dialog box.
    • In the Configure Response SLA Assertion dialog box, write 500 and click OK. This will validate that the response of the SLA is fewer than 500.
    • Now that you’ve added the assertion, you are going to run the request to validate the response. If all assertions are successful, the SOAP icon should turn green in three places .

You can also validate the response by adding an X-Path Match assertion.

  • In Soap UI Pro you can open the Select X-Path dialog, which lets you select nodes to assert using point-and-click. As a result Soap UI creates the matching X-Path expression that refers to the selected node.
  • Soap UI automatically populates the expected result to match what’s in the response. But of course, you can change this to what’s relevant for you.

Q#103. How to access the Project name from a Groovy Script Test Step?
Ans. testRunner.testCase.testSuite.project.name (Almost all items have a name property)

Q#104. How do I save the changes I make to my projects, requests, Test Cases, etc?
Ans. Soap UI automatically saves everything on exit. If you want to save your projects without exiting (for example if you want to commit your project file to CVS) use the “Save All” option in the main File menu

Q#105. How to Create a Mock Service?
Ans.
1. Right-click on one of the SOAP interfaces and selects Generate Mock Service.
2. In the dialog Generate Mock Service you can specify the local port/path for the service you’re creating but for the moment just click OK.
3. Enter the name of your Mock Service in the Name dialog and click OK.
4. after creating the Mock Service, you should get a Mock Service with one operation and one request.

Q#106. What languages are supported in SOAPUI?
Ans. Groovy and JavaScript

Q#107. What exactly WSDL document contains?
Ans. It is a document written in XML and used to describe web services.
It specifies the location of the service and the operations (or methods) the service exposes.

Q#108. Few tools used in your project if you used web services.
Ans. SOAP UI: Test the web service
Sometimes some of the back end services might not available, so you can create a mock response and run the web service from the soap UI. Then your program should hit the mock response and you can check the functionality.

Restful service calls:
HTTP PUT =>Create
HTTP GET => Retrieve
HTTP POST => Update
HTTP DELETE => Delete

GET: GET is the simplest type of HTTP request method; the one that browsers use each time you click a link or type a URL into the address bar. It instructs the server to transmit the data identified by the URL to the client. Data should never be modified on the server side as a result of a GET request.

PUT: A PUT request is used when you wish to create or update the resource identified by the URL.

DELETE: DELETE should perform the contrary of PUT; it should be used when you want to delete the resource identified by the URL of the request.

POST: POST is used when the processing you wish to happen on the server should be repeated, if the POST request is repeated (that is, they are not idempotent; more on that below). In addition, POST requests should cause processing of the request body as a subordinate of the URL you are posting to.

Q#109. Name a few HTTP status codes/messages
Ans.

  • 200 OK This response code indicates that the request was successful.
  • 201 Created This indicates the request was successful and a resource was created. It is used to confirm success of a PUT or POST request.
  • 400 Bad Requests The request was malformed. This happens especially with POST and PUT requests, when the data does not pass validation, or is in the wrong format.
  • 404 Not Found This response indicates that the required resource could not be found. This is generally returned to all requests which point to a URL with no corresponding resource.
  • 401 Unauthorized. This error indicates that you need to perform authentication before accessing the resource.
  • 405 Method Not Allowed The HTTP method used is not supported for this resource.
  • 409 Conflicts This indicates a conflict. For instance, you are using a PUT request to create the same resource twice.
  • 500 Internal Server Errors When all else fails; generally, a 500 response is used when processing fails due to unanticipated circumstances on the server side, which causes the server to error out.

Leave a Reply

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