Search This Blog

Tuesday 19 April 2016

SoapUI Interview Questions

Q #1. 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 #2. 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 #3. 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 #4. What are the different components can be used in the web services?
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 – eXtensible Markup Language
Q #5. 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 #6. 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 #7. 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 #8. 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 athttp://uddi.xml.org/
Q #9. 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
Q #10. 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
<?xml version=”1.0??>
<soap:Envelope xmlns:soap=”http://www.example.com/soap-envelope”>
<soap:Header>
</soap:Header>
<soap:Body>
<m:TutorialName>SoapUI</m:TutorialName>
</soap:Body>
</soap:Envelope>
Q #11. 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 #12. 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 #13. 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 #14. What is XML?
Ans. XML (eXtensible Markup 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.
Q #15. 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.
Q #16. 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 #17. 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 #18. 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 #19. What are SoapUI assertions?
Ans. Assertions compare the parts/all of the response message to the expected outcome.
Q #20. 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 #21. 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 #22. 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 #23. 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 #24. 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 #25. 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 #26. Can custom code be added to SoapUI? If yes, what can be added?
Ans. Yes -Groovy steps and Javascript steps.
Q #27. 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 #28. 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 #29. 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 #30. 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.
  1. Create project which has the endpoint information
  2. If necessary, change the endpoint and assign to the property through the property expansion test step
  3. Make sure the request information available in the given endpoint address
  4. 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 #31. 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 #32. 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.

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
Q #34. What data sources can be used in SoapUI?
Ans.
  • Excel Files
  • CSV Files
  • ODBC Sources
  • SQL / ADO Objects
—————————————————————————————————————————————————-
1) Explain what is SOAP UI?
SOAP UI is a free, open source cross-platform functional testingsolution.  It enables you to rapidly and easily create and execute automated regression, compliance, functional and load tests.
2) Explain what is the role of XML, SOAP, WSDL and UDDI in web services?
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.
3) Mention what SoapUI can do?
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
4) Mention how SoapUI is used to structure functional tests?
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
5) Mention what is the difference between REST and SOAP?
  • SOAP: Soap stands for Simple Object Access Protocol and it is a protocol used for receiving and sending data over HTTP as XML
  • REST: It is a way of designing a web services.
10-28-2014 3-43-57 PM
6) Explain what is the properties in SoapUI?
Properties in SOAPUI is used to retrieve and store data.  The data is stored as key, value or format.
7) Explain where you use properties in SoapUI?
We can read the property values into test step endpoint, username, header values, password, domain, POST, PUT, GET and DELETE method properties.
8) Mention what languages does SoapUI use?

SOAP UI supports two language, Groovy, and JavaScript.
9) Mention what are the default properties in SOAPUI?
By default, SOAPUI has properties at three levels
  • Project level default or custom properties: User can append any number of properties at project level and it can be opened from any test steps from any test cases under any test suites
  • Test suite level default or custom properties: User can append any number properties at test suite level and it can be used from any test steps from any test cases under this test suite
  • Test case level default or custom properties: At test case level users can add any number properties at test case level and it can be used from any test steps from this test case
10) Explain how you can parameterize the endpoints in SOAP UI?
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
11) Mention what is the general format for reading the custom or default property value?
The general format for reading the custom or default property value is ${#levelname#key}
12) Inside the SOAPUI where groovy script can be used?
Inside the SOAPUI groovy script can be used in two places
  • Groovy script test step
  • Script Assertion- within test step
13) Mention some important functionalities of SOAP UI?
Some important functionalities of SOAP UI are:
  • It creates a new project using only the web service WSDL link; it will get the information of all methods and import them automatically
  • It creates test cases directly from the web method request
  • It tests web methods in combination or separately. It has a very useful capability which allows datas and parameters to be passed from one method to another.  It enables you to save data in variables so other methods can access it
  • It enables creating validations on the web method results through assertions; the assertion can be created either in X-path or X-query
  • It helps in creating other types of validations like schema compliance, soap fault, response time etc.
  • It enables organizing the test cases in test suites
  • It enables running all test cases from a test suite and getting fail/pass results for each test case
  • It enables parameterization of the test cases request fields so that a test case can avail different values from a table or database
  • Using groovy it enables creating complex validation scripts
  • It has some support for web service load testing
  • It has some support for testing coverage and requirements management
14) Explain what assertion is in Soap UI is and give some example of assertion possible in SOAPUI?
In SOAP UI assertion functionality is used to validate the response of request received by the Test Steps at the time of execution.  It is used to compare a part of message to some expected value.
Assertion types in SOAPUI includes
  • 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
15) Does SoapUI support SSL Authentication
Yes
—————————————————————————————————————————————————-

What are the steps taken in SOAP processing model?

SOAP stands for Simple object access protocol and it describes the distributed processing model. There are different nodes are used and they are termed as SOAP nodes. These acts as a receiver of the processes and allows the access to the messages as well.
The nodes consists of the following process:
1. SOAP sender : It is a node that transmits the message received by the receiver.
2. SOAP receiver : It is a node that receives or accepts the message passed by the user.
3. SOAP message path : Is a node that sets the path to make it easy for the messages to go along and reach its destination.
4. Initial SOAP sender : Is also called as originator and it sends the message at the starting point of the message path and saves the settings there.
5. SOAP intermediary : Is a in between the SOAP receiver and SOAP sender that contains the SOAP message. It processes the header blocks that forward the SOAP message to the receiver.
6. Ultimate SOAP receiver : Is the node where the message gets received finally. This is responsible for the processing of the contents used by the SOAP body and the SOAP header also included in it.

What is the message format used in SOAP?

The message format is written by using the XML language that writes the standard message format as it is widely used. It allows easy transition to deliver the SOAP based implementations. The format of the protocol allows easy readability, ease of error detection and it removes the problems with interoperability like the byte order.
The message that is been given is in the format given below:
POST /InStock HTTP/1.1
Host: localhost
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 299
SOAPAction: “http://www.abc.org/2003/05/soap-envelope”&lt;?xml version=”1.0″?>
<soap:Envelope xmlns:soap=”http://www.abc.org/2003/05/soap-envelope”&gt;
<soap:Header>
</soap:Header>
<soap:Body>
<m:CareerName>Careeride</m:CareerName>
</soap:Body>
</soap:Envelope>

What is the use of having SOAP messages with attachments?

SOAP messages can be attached with MIME extensions that come in multipart/related. It is used to send messages using the binary data with certain defined rules that are applied on it. The SOAP message is carried in the body part with the structure that is followed by the message of the SOAP. The MIME extension when used with SOAP consists of a content-id that uniquely identifes the content that is being used and the location of it. There are many ways through which the extension of the SOAP capabilities can be applied to the new applications. SOAP messages are used with the attachments to make it more portable and user friendly. The MIME type can be a audio or video or any other media related type that is associated with a web page.

What is the difference between SOAP and other remote access techniques?

1. SOAP is simple to use and it is non-symetrical whereas DCOM or CORBA is highly popular and usually have complexity in them. It also has the symmetrical nature in it.
2. SOAP provides greater platform independent with the language independence whereas DCOM or CORBA doesn’t provide any of these.
3. SOAP uses HTTP as its transport protocol and the data are being saved in XML format that can be ready by human, whereas DCOM or CORBA have their own binary formats that are used to transport the data in complicated manner.
SOAP indefiy the object other than URL endpoint. SOAP objects are stateless and it is hard to maintain that. Whereas, it is not hard to maintain in case of other remote access techniques.

What is the procedure followed on the client side?

SOAP allows the right message to be passed and sent by the caller to the server need to be sent properly. The message should be appropriate and usually consists inside the SOAP envelope and it is being inserted in an optional Header and the body that is compulsory to be used. The message that is being written are encoded in XML format.
The SOAP program will show the code that allows the code is to be written.Like:
POST /StockPrice HTTP/1.1
Host: http://www.careerride.com
Content-Type: text/xml
Content-Length: nnnn<SOAP-ENV:Envelope xmlns:SOAP-
ENV=”http://www.careerride.com/career/ride/&#8221;
xmlns:xsi=”http://www.abc.org/1999/XMLSchema/instance/&#8221;
xmlns:xsd=”http://www.abc.org/1999/XMLSchema/”&gt; //Envelope & Headers
<SOAP-ENV:Body>
<ns1:getAddressFromName xmlns:ns1=”urn:AddressFetcher” SOAP-
ENV:encodingStyle=”http://www.careerride.com/career/ride/”&gt;
<nameToLookup xsi:type=”xsd:string”>John B. Good</nameToLookup>
</ns1:getAddressFromName>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

How does building a call allows the communication to take place in between the client and the server using SOAP?

The process is quite simple when using SOAP to establish the communication between the client and server. The steps that are involved are:
Make a call to the client side to send the request for the data access and it will be made like this:
Call call = new Call();
call.setTargetObjectURI(“urn:test”);
call.setMethodName(“test”);
call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
URL url = new URL
(“http://localhost:8080/soap/ob.jsp&#8221;);
Vector params = new Vector();
params.addElement(new Parameter(“value”, String.class, first, null));
call.setParams (params);
This program shows the building of the call class and then the target gets specified to the target method name. The target method name allows the server to know where to send the data. After setting this then the target object URI gets selected, it identifies the URL where the resource is located. The “NS_URI_SOAP_ENC” set the encoding style URL and allows it to add the parameter which is the new parameter value. This allows the data exchange between the client and the server. Building a call can be done using the SOAP API that provides lots of requests to be processed.

What is the procedure to send the call and get the response from the client to server using SOAP?

To get the response after sending the call the user need to invoke the URL of the router which routed the information and which consists the information of the server.
The following statement will set then invocation to get the response and set that in the database.
Response resp = call.invoke( url, “”);
Parameter result = resp.getReturnValue ();
System.out.println (result.getValue ());
This allows the printing of the result in the standard output window. There will be used exception handling tag that will keep track of any error that might come in between while executing the statement and taking the response from the users.

How does the processing of the call() function happens on the server side using SOAP?

The call() on the server routes the message to the server that consists of a java object or any other object depending on the user language usage. This object waits for the method to get invoked. It can invoke any object doesn’t matter local or remote as it will allow all the function to be invoked in the same way as others.
The calling of the function will be shown as:
class test
{
private String result;
public String test1(String a)
{
result = a + ” testing of the invoking of object”;
return(result);
}
}
the function returns the type String and it is the simplest type of SOAP. It tests the server that allow the call function to call the right resource method.

What are the steps involved in doing the data exchange between the client and the server?

The data that is exchanged between the client and server is in XML format and the SOAP passes the object between its methods and the object of the type parameter. SOAP deploys the service that is supplied in the Deployment management area and it is also an administrative tool. It keeps all the information about the services that are running on the web server. This is necessary to be done to keep the routing of the calls to identify the resource uniquely by using different parameters like different names and types. It is used to deploy the services for the client that sends the requests. Un-deploy or remove the services that are already deployed. Show the list of all the services that are deployed on the server and taking necessary actions on them.

What are the information contained in the service deployment model?

The service deployment information consists of all the services that are deployed on the server. It consists of the deploy function that can be used from a list of functions.
There are some properties that are used and provided with the services. It includes the following:
1. ID : It identifies the services uniquely that is being provided to the clients. It should be unique among the deployed services. It consists of a format that is urn:UniqueServiceID. It targets the object ID, and the specifications that has to be provided with it.
2. Scope : It defines the lifetime of an object that is serving the request coming from the client. This is having the specific format given as <jsp:useBean> tag. This also consists of properties like page: that the object is available or not to respond back to the request.
3. request : The request of the object and its availability to fulfill the request.
4. session : Allows the object to find the availability to get it for the complete session till the object is alive

Give examples where SOAP is used.

1. Different application running on different types of operating systems and using different technologies.
2. Example : To find company details, a SOAP request GetCompanyDetail() is sent to the server with the company id as the parameter. In response, details of company are returned via XML.

Give examples where SOAP is used.

Remote methods over multiple platforms and technologies are used with HTTP. SOAP is XML based protocol and platform-agnostic. Each application uses different technology. This may cause problems with proxy server and firewalls. SOAP is the solution for this situation.
Industries transport the request for finding best route and best cost price. So the application transfers a request to other similar services which uses SOAP.

What are transport methods in SOAP?

1. Different application running on different types of operating systems and using different technologies.
2. Example : To find company details, a SOAP request GetCompanyDetail() is sent to the server with the company id as the parameter. In response, details of company are returned via XML.
SOAP request
<?xml version=”1.0″?>
<soap:Envelope
xmlns:soap=http://www.w3.org/2001/12/soap-envelope
soap:encodingStyle=”http://www.abc.org/2001/12/soap-encoding”&gt;
<soap:Body xmlns:m=”http://www.example.org/ company “>
<m: GetCompanyDetail >
<m:CompanyID>1234></m:CompanyID >
</m: GetCompanyDetail >
</soap:Body>
<soap:Envelope>
SOAP response
<?xml version=”1.0″?>
<soap:Envelope
xmlns:soap=http://www.w3.org/2001/12/soap-envelope
soap:encodingStyle=”http://www.abc.org/2001/12/soap-encoding”&gt;
<soap:Body xmlns:m=”http://www.example.org/company”&gt;
<m: GetCompanyDetailResponse>
<m:name>ABC</m:name>
<m:revenue>20000</m:revenue>
</m: GetCompanyDetailResponse >
</soap:Body>
</soap:Envelope>

What are Transport methods in SOAP?

Application layer and transport layers of a network are used by SOAP. SMTP and HTTP are the valid application layer protocol uses as transport for SOAP. Wider acceptance is gained by HTTP, as it works better with the current internet infrastructure, especially with firewalls.

Explain the role of XML in SOAP.

– XML is used as a message format to communicate. Due to the open source nature of XML, it is widely accepted.
– XML is used as the common format for data in cross platform applications. This file is used for representing message for communication. XML is mostly accepted standard for open source applications. XML format is more reliable format for Application Layer protocols for message transmission and negotiation.

What are the elements that should be contained in SOAP message?

1. Envelope – Translates the XML document to a SOAP message. It is the root element.
2. Header – Contains the header message. Contains the application specific information.
3. Body – Contains the call and response message.
4. Fault element – Used for communicating errors. If present, it appears as a child element of the body and can appear only once.

What are the elements that should be contained in SOAP message?

The following are contained in SOAP messages:
1. Envelope Element : XML document identification and translation into a SOAP compatible message is done by this element.
2. Header Element : The header message is available in his element.
3. Body Element : The call and response message is available in the body element.
4. Fault Element : Errors occurred during the process is handled by fault element.

No comments:

Post a Comment