web services automation from sketch

22
Web services automation from sketch

Upload: it-weekend

Post on 29-Nov-2014

136 views

Category:

Software


3 download

DESCRIPTION

by Mykola Tverdohlib, Senior Test Automation Engineer, SoftServe

TRANSCRIPT

Page 1: Web services automation from sketch

Web services automation from sketch

Page 2: Web services automation from sketch

Web services?

Page 3: Web services automation from sketch
Page 4: Web services automation from sketch

Two main standards for web services

• REST

• SOAP

Page 5: Web services automation from sketch

REST

• Rather an architecture style, not a standard

• Data and functionality are considered resources and are accessed

using Uniform Resource Identifiers

• Works over HTTP (CRUD)

Page 6: Web services automation from sketch

SOAP

• Pure standard

• Relies on XML information set for its message format

• Based on sending/receiving messages

Page 7: Web services automation from sketch
Page 8: Web services automation from sketch

<?xml version="1.0"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"> <soap:Header/> <soap:Body>

</soap:Body></soap:Envelope>

Page 9: Web services automation from sketch

How SOAP works

Page 10: Web services automation from sketch

+

Page 11: Web services automation from sketch

How to build a framework

Page 12: Web services automation from sketch

• Create interaction between end user and a framework

• Fill XML template with data

• Send XML request to server

• Validate XML response from server and return it to user

• Create a class responsible for parsing response

Page 13: Web services automation from sketch

• Create a class representing XML template

• Associate class with XML template

• Create a util that fulfills XML template with a data from class

• Create Soap Client based on javax library

• Create class simulating response from server

Page 14: Web services automation from sketch

Creating tests

+

Page 15: Web services automation from sketch

Assertions

Page 16: Web services automation from sketch

Login into application. Request<?xml version='1.0' encoding='UTF-8'?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema">

<SOAP-ENV:Body><Authenticate xmlns="urn:MySOAPService">

<userName>admin</userName><password>admin_password</password>

</Authenticate ></SOAP-ENV:Body>

</SOAP-ENV:Envelope>

Page 17: Web services automation from sketch

Login into application. Response<AuthenticateResponse>

<Status>OK</Status><session>sdlkfjJISDUhklds67skadjli</session>

</AuthenticateResponse>

Page 18: Web services automation from sketch

Create a user. Request<CreateUser xmlns="urn:MySOAPService">

<userName>dart</userName><password>dart_password</password><email>[email protected]</email>

</CreateUser>

Page 19: Web services automation from sketch

Create a user. Response<CreateUserResponse>

<Status>OK</Status><UserId>52345</UserId>

</CreateUserResponse>

Page 20: Web services automation from sketch

Go beyond

Page 21: Web services automation from sketch

• Continuous Integration

• End to end automation in case of desktop and web

architecture

Page 22: Web services automation from sketch