Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

Differentiate between SOAP and REST.

Answer»

Before differentiating between SOAP and REST, let us first look at what these are:

  • SOAP: A SOAP API is an XML DOCUMENT receiver that is also EXPECTED to react with an XML document. The XML document provided should include all parameters that the receiver must be able to respond to. Due to their difficulty in integrating across enterprises, SOAP APIs have recently lost favour.
  • REST: REST is an architectural methodology for scalable web applications that stands for Representational State Transfer. A "REST-ful" web service is one that places less emphasis on rigid formatting and instead uses JSON (JavaScript Object Notation) formatted data in MESSAGE bodies rather than XML, while there is still a lot of XML in a RESTful web service.

The key differences between SOAP and REST are  as follows:

SOAP REST
SOAP (Simple Object Access Protocol) cannot make use of REST because of the fact that SOAP is just a protocol while REST is an architectural pattern.It is possible for REST(Representational State Transfer) to make use of SOAP as an underlying protocol USED for web services since REST  is an architectural pattern.
SOAP stands for Simple Object Access Protocol. SOAP was created with a set of guidelines in mind. It includes a WSDL file that contains the needed information on what the web service does as well as the web service's location.REST is an architectural approach in which a web service can only be considered RESTful if it complies with the following constraints: Client-Server, Stateless, Cacheable, Layered System and  Uniform Interface.
The only XML format is supported with SOAP since it can work only using XML data.REST can support various types of data formats, for instance, HTML, Plain text, XML, JSON, etc. with the most preferable format being JSON (JavaScript Object Notation).
SOAP exposes its functionality to client applications through service interfaces. The WSDL file in SOAP supplies the client with the essential information to determine what services the web service can provide.

To access the components on the HARDWARE device, REST uses Uniform Service locators. For example, if an object representing an employee's data is hosted at http://docs.google.com, the following are examples of the URIs that can be used to retrieve it.

<?xml version="1.0"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2001/12/soap-envelope" SOAP-ENV:encodingStyle=" http://www.w3.org/2001/12/soap-encoding"><soap:Body><Docs.googleWebServicexmlns="http://tempuri.org/"> <DocumentId>int</DocumentID> </Docs.googleWebService></soap:Body></SOAP-ENV:Envelope>{"city":"Kolkata","state":"West Bengal"}
2.

What do you understand about WSDL?

Answer»

WSDL: WSDL is an acronym for Web Services Description Language. It is connected to SOAP. It defines how the Web service works so that you may refer to it when you make a REFERENCE to it. The Web Services Description Language (WSDL) is an XML-based interface description language for specifying a web service's capabilities. Any specific WSDL description of a web service (also referred to as a WSDL file) that offers a machine-readable explanation of how the service can be called, what parameters it EXPECTS, and what data structures it returns is also referred to by the acronym. As a result, it serves a similar purpose to a type signature in a programming language.

Services are described in the WSDL as groups of network endpoints or ports. For this reason, the WSDL definition specifies an XML format for documents. The abstract definitions of ports and messages are abstracted from their real application or instance, allowing them to be reused. A service is defined by associating a network address with a reusable binding, and a group of ports is formed by associating a network address with a reusable binding. Port types are abstract collections of supported operations, while messages are abstract descriptions of the data being exchanged. The concrete protocol and data format specifications for a specific port type comprise a reusable binding, which BINDS operations and messages to a specific network protocol and message format. WSDL DESCRIBES the public interface to the Web service in this way.

3.

State the steps to add assertions in SoapUI.

Answer»

On receiving a response to a REQUEST, do the following steps:

  • CREATE a project and include the WSDL.
  • Include a test suite, a test case, and a set of test steps.
  • Execute the request

Now to add assertions, perform the following steps:

  • Go to the top of the LOG tabs and click Add Assertions.
  • Configure the assertions according to the data and TYPE needed.
4.

What do you understand about XPath Assertion in SoapUI? Also, state your understanding of Data Driven Testing.

Answer»

The XPath assertion is used in SoapUI to assert the value of a web service response by specifying the absolute path. The test case or test suite will be marked as PASS if the absolute path matches the response value; otherwise, it will be marked as FAILED. The assertion results can be seen at the BOTTOM of the screen in the Assertion tab. XPath assertion selects the target node and its values using an XPath expression. It compares an XPath expression's result to an expected value. XPath is an XML query language that allows you to pick nodes from an XML document. Given below are the steps which can be taken in order to add an XPath Assertion  in SoapUI:

  • SELECT Assertion Category – Property Content after clicking Add Assertion.
  • Then click Add and pick Assertion Type – XPath Match. The wizard for XPath Match Configuration appears. The NameSpace must be DECLARED before an XPath may be added. An XML namespace is a set of names that are used as element and attribute names in XML documents and are identifiable by a URI reference. SoapUI XPath Assertion does the same thing.
  • Click the 'Declare' button to automatically declare an XML Namespace; otherwise, manually declare a namespace.
  • Refer to the XPath using the newly established namespace after declaring the namespace. When you click the 'Declare' button, two NAMESPACES with two URIs will appear. The schema URL is one of them, while the REAL web service URL is the other. When accessing XPath, we must use the real namespace where the web service is situated, not the schema namespace.
  • Input the XPath of the XML node which needs to be checked. //ns1:ConversionRateResult gives the value of the node enclosed between <ConversionRateResult> and </ConversionRateResult> and ns1 stand for the declared namespace pointing to 'www.webserviceX.NET'.
  • After inputting the XPath, click the 'Select from current' button to take up the value from the current answer for future comparison. The user has the ability to change the value.
  • Save the file. 

As demonstrated in the accompanying screenshot, the added assertion will be presented.

Data Driven testing entails storing our test data, which includes both input and expected output, in an external data source such as Excel, Database, or XML file. The data source must then be iterated using the appropriate component. For data-driven testing in SoapUI, the Datasource and Datasource Loop test steps are employed.

5.

What are the steps to parameterize endpoints in SOAP UI?

Answer»

It is critical to parameterize the endpoints in SOAP UI because it is the initial step in Automation Testing. Manually updating endpoints is more TIME demanding. In order to accomplish this, we can do the following steps:

  • Create a project property that STORES the endpoint.
  • Using property expansion, change the endpoint to use this property.
  • Ascertain that your requests use the configured endpoint.
  • The property will invariably be with its CURRENT value when a request is run. SIMPLY configure the endpoint in the User Interface (UI) to use a different value, or use the P option from the command LINE.
6.

State a few important functionalities of SOAP UI.

Answer»

A few important functionalities of SOAP UI are as follows:

  • It BUILDS a new project-based just on the web service WSDL link; it retrieves all method information and imports it automatically.
  • It generates test cases from the web method request itself.
  • It evaluates web techniques individually or in combination. It includes a very important feature that allows you to transmit data and arguments from one method to another. It allows you to PRESERVE data in variables so that it may be accessed by other methods.
  • It allows you to use assertions to validate web method results; assertions may be WRITTEN in either XPATH or Xquery.
  • It aids in the creation of various validations such as schema compliance, SOAP fault, response speed, and so on.
  • It allows you to organise your test cases into test suites.
  • It allows you to execute all of the test cases in a test suite and get fail/pass results for each one.
  • It allows parameterization of test case request fields, allowing a test case to access various values from a table or database.
  • It is POSSIBLE to create complicated validation scripts using Groovy.
  • It has some load testing features for web services.
  • It has various features to help with testing coverage and requirements management.
7.

State and explain the default properties in SOAPUI.

Answer»

SOAPUI PROVIDES three layers of properties by default:

  • Project level default or custom properties: The USER can add any number of properties at the project level, and it can be opened from any test step in any test case under any test suite.
  • Test Suite level default or custom properties: Any number of CHARACTERISTICS can be appended at the test suite level, and they can be utilised from any test step in any test case under this test suite.
  • Test Step level default or custom properties: Users can add any number of properties to a test case at the test case level, and these properties can be utilised in any test step from this test case.
8.

What are assertions in SoapUI? State some of the important assertions present in SoapUI.

Answer»

In SoapUI, assertions are used to validate the message that a Test Step receives during execution, usually by comparing sections of the message (or the full message) to an expected value. A sample Test Step can include any number of assertions, each validating a particular element or content of the answer. The parts/all of the answer responses are compared to the expected outcome in assertions.

Some of the important assertions present in SoapUI are as follows:

  • WS security status: SoapUI manages WS Security CONFIGURATIONS at the project level, allowing them to be utilised in several locations within a project:
    • For incoming and outgoing requests, as well as responses.
    • Incoming MockServices requests and their MockResponses.
    • In the SOAP Monitor, for monitored requests and their monitored answers.

On the project level, there are four sub-tabs under the WS Security Configurations tab:

  1. Outgoing WS-Security Configurations: configurations for outgoing messages, such as requests and MockResponses. Encryption, signing and adding SAML, timestamp, and username headers are all done with this configuration type.
  2. WS Security Configurations for Incoming Messages: configurations that should be applied to incoming messages, such as responses, MockRequests, or monitored requests and responses. This configuration type is used to decode and validate incoming messages' signatures.
  3. Keystores: Encryption, DECRYPTION, and signature keys are stored in keystores.
  4. Truststores: Truststores used for signature verification.
  • XPath Match: The XPath ASSERTION applies a defined XPath expression to the incoming message and compares the nodes to a predetermined value. The assertion succeeds if the values match; else, it fails. Let us  take a look at a login response message that we would like to verify:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sam="http://www.example.org/sample/"> <soapenv:Header/> <soapenv:Body> <sam:loginResponse> <sessionid>12406604040526722</sessionid> </sam:loginResponse> </soapenv:Body></soapenv:Envelope>

Essentially, we want to look for the loginResponse and sessionid components in the SOAP Body, but ignore the sessionid's actual value because it will change between requests.

  • XQuery Match: To pick information from the target property, XQuery employs an XQuery expression. It compares an XQuery expression's result to an expected value and it is applicable to any property CONTAINING XML.
  • Script Assertion: The Script Assertion enables arbitrary message validation, such as message content, HTTP headers, and so on. Validation scripts are written in the project scripting language (Groovy or JavaScript) and run when the assertion status of the containing sampler Test Step changes.
  • Simple Contains: It searches for the existence of a string in the property value and supports regular expressions. It is applicable to any property.
  • Soap Faults: Soap Faults check whether the response is a SOAP Fault (used for negative testing).
  • Not Soap Faults: Not Soap Faults check whether the response is not a SOAP Fault.
  • Response SLA: Response SLA checks the response time against a particular value which is given.
  • WS Addressing Response: WS Addressing Response validates the availability of WS Addressing Headers in the response
  • Schema Compliance: Schema compliance validates the response message against the WSDL (Web Service Description Language) definition and the XML Schema it contains.
  • Simple not Contain: It searches for the non-existence of a string in the property value and supports regular expressions. It is applicable to any property.
  • SOAP Response: Verifies that the response is a genuine SOAP message; used to ensure that we are receiving a response (if no assertions are added a connection ERROR will not cause a failure).
  • JMS Timeout: When utilising a JMS endpoint with a response channel provided, this assertion verifies that the response is received within the specified time.
  • JMS Status: This assertion verifies that no JMS related issues occurred when using a JMS endpoint.
9.

How can we use SoapUI to test a WCF rest service?

Answer»

For a constantly accessible service on an IIS (Internet Information Services) web server or just a service in an application, WCF gives the ability to send asynchronous messages between service ENDPOINTS. WCF (Windows Communication Foundation) is a core framework that ALLOWS you to create services with a web endpoint and deliver data using XML or JSON without using a SOAP wrapper. The steps to use SoapUI to test a WCF rest service are as follows:

  • Clicking on File -> NEW SoapUI PROJECT will start a new project. Fill in the blanks in the dialogue box, and do not forget to include the Initial WSDL parameter by adding the WCF URI.
  • A new SoapUI project is created after clicking Ok.
  • Then, much like the WCF Test Client, make the IDENTICAL request.
10.

In SoapUI, how do you test an SAP Web Service?

Answer»

A web service is a modular and self-describing function or service that is supplied over HTTP. For service description and availability, web services use XML and other standards, as well as other internet or HTTP protocols. The WSDL files are essential for testing SOAP-based services. Test ASSERTIONS, test requests, and MOCK services can all be described using WSDL files. Steps to test an SAP Web Service using SoapUI, which requires a WSDL file are as follows:

  • In SoapUI, select Create SOAP Project or File > New SOAP Project to start a new one.
  • In the DIALOGUE box that displays, type the SAP URI in the Initial WSDL area.
  • Click OK to accept the default SETTINGS.
11.

In SoapUI, how do you test an ASMX web service?

Answer»

ASMX provides online services with a messaging feature based on the Simple Object Access Protocol, or SOAP. The basic files required for TESTING SOAP-based web services are WSDL files. As a result, SoapUI uses WSDL files to generate test requests, mock services, and assertions. The following are the steps to test an ASMX web service in soapui that requires WSDL.

  • In SoapUI, select Create SOAP PROJECT or File > New SOAP Project to start a new one.
  • In the dialogue box that displays, type the ASMX URI in the INITIAL WSDL area.
  • Click OK to accept the DEFAULT settings.
12.

In SoapUI, what is the most basic approach for automating web services?

Answer»

The most BASIC approach for automating web services in SOAPUI is as follows:

  • Make a project and INCLUDE the WSDL (Web Service Description LANGUAGE) file in it.
  • Include custom programming/validation utilising Groovy steps by adding test suites, test cases, and test cases in that order.
  • If you are using external data sources, add assertions if necessary, and then RUN.
13.

What are the advantages of using SoapUI? How does SoapUI structure functional tests?

Answer»

The advantages of using SoapUI are as follows:

  • SoapUI can run load tests (Load testing is a type of non-functional software testing in which a software application's performance is evaluated under a certain load which determines how the software application operates when numerous people access it at the same time. Load testing is used to identify performance bottlenecks and ensure the stability and smooth operation of software applications prior to DEPLOYMENT), scenario-based tests (Scenario-based testing is one way to document the project's software specs and needs. 
    Scenario-based testing is a method of designing tests for INDIVIDUAL user scenarios in order to ensure that their job is correct. Scenarios focus on the most important goals and requirements. The scenario passes if it runs from beginning to end. Scenario-based software testing may be described as an inspection-based collection of tests that are run to ensure that the user can execute the specified actions from start to finish. 
    There are alternative ways to depict scenarios, such as a table with the first column describing the user's actions and the second describing the system's response), and data-driven tests (Data-driven testing (DDT), also known as table-driven testing or parameterized testing, is a software testing methodology that describes testing that USES a table of conditions directly as test inputs and verifiable outputs, as well as the process of not hard-coding test environment settings and control. In its most basic version, the tester PROVIDES inputs from a table row and anticipates outputs from the same row. Values that correspond to BORDER or partition input spaces are often found in the table. The test configuration is "read" from a database in the control approach) automatically.
  • It has the capabilities to generate reports for the tests performed using it.
  • SoapUI provides the unique ability to impersonate Web services and perform functional and load tests against them prior to their execution.

Functional tests are organised using three layers in SOAP UI:

  • Test Suite: A Test Suite is a collection of test cases that are used to group functional tests into logical units.
  • Test Case: A Test Case is a collection of test procedures used to evaluate a single feature of your services. Any number of Test Cases can be added to test suites.
  • Test Steps: In SOAPUI, Test Steps are the "building blocks" of functional tests. They work together to create Test Cases, which determines the service's execution flow.
14.

How can we use SoapUI for the testing of Restful Web Services?

Answer»

In order to use SoapUI to TEST restful web SERVICES we can do the following: Using SoapUI to test restful web services REQUIRES first developing test cases, after which the following actions can be followed.

  • The next step is to make a REST Request. By using the "Add to TestCase" button (FOUND on the top left of the message editor) or the "Add to TestCase" action from the Request Popup
  • Menu, TestStep can be added to a new or existing TestCase.
  • After that, we must include Assertions in order to validate the response message.
15.

State your understanding of SoapUI automation.

Answer»

SOAP or Simple Object ACCESS Protocol is a protocol that uses XML to interact with web applications. With the help of XML based content, it can make communication happen between two client machines across any network. SOAPUI is a cross-platform functional testing solution that is free and open source. It ALLOWS US to develop and run automated regression, compliance, functional, and load tests quickly and easily. SoapUI is currently being used to test Web Services. SOAP UI automation refers to the use of SOAP UI SOFTWARE for automation testing and implementation. 

16.

What do you understand about web services? State some of the communication channels which are available for a web service.

Answer»

Web services are web components that allow clients and servers to exchange data. The client SUBMITS a web request to the server, which is subsequently RESPONDED to by the server. The response and the request are linked, and different REQUESTS elicit different responses. A web component or software program that can be accessed through the Internet is known as a web service. Through XML communications ideas, it is mostly used to communicate with web-based applications. For example, if we wish to utilize Google Maps to find a SPECIFIC location, we can use the relevant web service's URL. To do so, we must provide the necessary inputs.

In general, web services are used in conjunction with the protocols listed below:

  • HTTP / POST: The HTTP / POST protocol is used to securely send data between clients.
  • HTTP / GET: Clients can display sent data partially in the browser's address bar using the HTTP / GET protocol.
  • SOAP: SOAP is a protocol for securely transmitting private data.

These channels will be utilised to communicate with customers when exposing web services.