четвер, 28 січня 2016 р.

How to test SOAP service in Eclipse by Webservice Explorer

1. create soap service
2. run on server the project
3.copy the wsdl
4. go to Run/Launch Webservice Explorer

How to test SOAP service

1. click soap service
2. create war file and deploy to Tomcat
3. test by SoapUI
create project and input wsdl file
message should be sent for testing soap service. For testing rest service URI should be send

Create SOAP web services in java(JAX-WS) using Apache CXF

1. create Dynamic web project
2. create interface ICalculator

How to push existing project to github

1. create repository in github
2. On your machine, first you will need to navigate to the project folder using git bash. When you get there you do:
git init
which initiates a new git repository in that directory.
When you've done that, you need to register that new repo with a remote (where you'll upload -- push -- your files to), which in this case will be github. You'll get the correct URL from your repo on GitHub.
$ git remote add origin https://github.com/[username]/[reponame].git
You need to add you existing files to your local commit:
git add .   # this adds all the files
Then you need to make an initial commit, so you do:
git commit -a -m "Initial commit" # this stages your files locally for commit. 
                                  # they haven't actually been pushed yet
Now you've created a commit in your local repo, but not in the remote one. To put it on the remote, you do the second line you posted:
git push --set-upstream origin master
3. Right click your project, select Team -> Share Project -> Git. Select the proposed line and press "Create repository". Press finish

HTTP Status Codes

Sr. No.HTTP CodeDescription
1200OK, shows success.
2201CREATED, when a resource is successful created using POST or PUT request. Return link to newly created resource using location header.
3204NO CONTENT, when response body is empty for example, a DELETE request.
4304NOT MODIFIED, used to reduce network bandwidth usage in case of conditional GET requests. Response body should be empty. Headers should have date, location etc.
5400BAD REQUEST, states that invalid input is provided e.g. validation error, missing data.
6401UNAUTHORIZED, states that user is using invalid or wrong authentication token.
7403FORBIDDEN, states that user is not having access to method being used for example, delete access without admin rights.
8404NOT FOUND, states that method is not available.
9409CONFLICT, states conflict situation while executing the method for example, adding duplicate entry.
10500INTERNAL SERVER ERROR, states that server has thrown some exception while executing the method.

How to test REST service

1. create service
2. deploy it on Tomcat or run locally in Eclipse "Run on server"
3. test by SoapUI
   add REST project in SoapUI

пʼятниця, 22 січня 2016 р.

Create RESTful web services in java(JAX-RS) using Apache CXF

Java API for RESTful Web Services (JAX-RS), is a set if APIs to developer REST service. JAX-RS is part of the Java EE6
Apache CXF is an open source services framework. CXF helps you build and develop services using frontend programming APIs, like JAX-WS and JAX-RS
In this article we will build a service and deploy it on Tomcat

How to create APACHE CXF REST service Calculator


  1. Create a Java Project
  2. Configure to Maven project
  3. in pom file add JAX RS and  APACHE CXF dependencies
  4. Create a Java class ‘CalcREST’ and type the following code. 

четвер, 21 січня 2016 р.

About REST and SOAP services

1. Web services is a technology for transmitting data over the Internet and allowing programmatic access to that data using standard Internet protocols, typically HyperText Transfer Protocol (HTTP).
2. You can think of an individual Web service as a piece of software that performs a specific task (also known as a function), and makes that task available by exposing a set of operations that can be performed (known asmethods or Web methods) with the task. Additionally, each of the methods exposes a set of variables that can accept data passed into the method. These variables are known as parameters or properties. Together, the properties and methods refer to a Web service's interface.
3. Web services provide an application integration technology that can be successfully used over the Internet. 
4. based Web applications that interact with other web applications for the purpose of exchanging data. Web Services can convert your existing applications into Web-applications.
5. A web service takes the help of WSDL to describe the availability of service. It provides a definition of how the Web service works, so that when you create a reference to it
6. WSDL is an XML-based language for describing web services and how to access them.
7. SOAP is an XML-based protocol for exchanging information between computers.
8. Simple Object Access Protocol (SOAP) and REpresentational State Transfer (REST) are two answers to the same question: how to access Web services. 
9. Web services are client and server applications that communicate over the World Wide Web’s (WWW) HyperText Transfer Protocol (HTTP)


Rest:
1. RESTful web services are based on HTTP protocol and its methods PUT, GET, POST, and DELETE. These web services are better integrated with HTTP than SOAP-based services are, and as such do not require XML SOAP messages or WSDL service definitions


вівторок, 19 січня 2016 р.

Types of Automation Frameworks

types of automation frameworks
  1. Linear – Simplest form of creating a test. Just write a one single program without modularity in sequential steps
  2. Keyword driven – Create different keywords for different set of operations and in the main script we can just refer to these keywords.
  3. Data driven – To run same set of operations on multiple sets of data that are kept in separate files, mostly excel sheets.
  4. Hybrid – A combination framework that can be partly data driven and partly keyword driven
  5. BPT – This just means that programs are broken down into business components and are used with one or the other of the above types of frameworks
link

Below are the different types of frameworks:

  1. Module Based Testing Framework: The framework divides the entire “Application Under Test” into number of logical and isolated modules. For each module, we create a separate and independent test script. Thus, when these test scripts taken together builds a larger test script representing more than one module.
  2. Library Architecture Testing Framework: The basic fundamental behind the framework is to determine the common steps and group them into functions under a library and call those functions in the test scripts whenever required.
  3. Data Driven Testing Framework: Data Driven Testing Framework helps the user segregate the test script logic and the test data from each other. It lets the user store the test data into an external database. The data is conventionally stored in “Key-Value” pairs. Thus, the key can be used to access and populate the data within the test scripts.
  4. Keyword Driven Testing Framework: The Keyword driven testing framework is an extension to Data driven Testing Framework in a sense that it not only segregates the test data from the scripts, it also keeps the certain set of code belonging to the test script into an external data file.
  5. Hybrid Testing Framework: Hybrid Testing Framework is a combination of more than one above mentioned frameworks. The best thing about such a setup is that it leverages the benefits of all kinds of associated frameworks.
  6. Behavior Driven Development Framework: Behavior Driven Development framework allows automation of functional validations in easily readable and understandable format to Business Analysts, Developers, Testers, etc.

How to Select Correct Test Cases for Automation Testing

Step 1:
Identify the parameters on which you will base your test case as a candidate for automation.
As of now I am identifying the below parameters, you can have your own parameters depending on your application.
  • Test case executed with different set of data
  • Test case executed with different browser
  • Test case executed with different environment
  • Test case executed with complex business logic
  • Test case executed with different set of users
  • Test case Involves large amount of data
  • Test case has any dependency
  • Test case requires Special data

Advantages of automation

There are many advantages of automation:

  1. Useful to execute the routine tasks like smoke tests and regression tests. 
  2. Useful in preparing the test data. 
  3. Helps to execute the test cases which involve complex business logic.
  4. Good to execute the cross platform test cases (like different OS, browsers etc.) 
  5. Great to execute the test cases which are a bit difficult to execute manually. 
  6. When the number of iterations of the test case executions are not known.

Web Site Test Tools and Site Management Tools

Links to useful resources: