Wednesday, July 22, 2020

Soap UI- Integrating Soap UI and CI/CD process and Jenkin

Integrating Soap UI and CI/CD process

  • New item> enter name “build project” free style project > click save
  • Go to dashboard
  • New item> enter name “test project” freestyle  and click save
  • Go to dashboard
  • New item> enter name “deploy project” freestyle and click save
  • Go to dashboard
  • Click on build project> click on configure> source code management> build tab> build> execute shell (command pre return code in command ) and continue
  • Go to dashboard
  • Click on deploy project> click build> execute windows batch command and command enter pre code and save
  • Go to dashboard
  • Click test project> click build > execute shell and prerun code and save
  • Go to dashboard
  • Build project> configure> post build action> build other pojrect> test project> save
  • Go to dashboard
  • Test project>configure>post build action>build other project>deploy project>save

 Soap UI and Jenkins

  • Click on project folder contains WSDL file and APIs and test suits
  • Right click on test case>launch test runner and default setting and launch, click the cancel and copy project directory path and paste in notepad
  • Next Soap UI test runner- copy file command and paste in notepad remove till cmd c:
  • Launch cmd, cd desktop
  • Java -jar Jenkins.war
  • Jenkin fully up and running message and launch web browser and with local host 8080
  • New item>jenkinsoapuidemo, build> execute windows batch command, past e the directory path and command, live the first line with c: and
  • Go to dashboard
  • Build now

 


Soap UI- basics steps to create Groovy Scripting

Groovy scripting

  • Groovy is oops language- use java
  • Quite similar to python and ruby
  • Project contain WSDL file and APIs to test
  • Create test suits first
  • Right click on WSDL and create test suite name grovy test suite
  • Right click on grovy test script>new test case and name grovytestcase and ok
  • Right click on grovy test step>create test step and launch editor and write script
  • Log.info(“our first script”)
  • A=5;
  • B=10;
  • Log.info(a+b);

Soap UI- Assertions

Assertion in SOAP UI

  • Assertion signify stating something or validation roles for test results
  • Used for validation request and response
  • Compares entire message with expected values
  • Can add multiple assertions
  • Provides execution log for failed entry

 Assertions related to property content

  • Contains
  • Not contains
  • Xpath match
  • Xquery match

 Assertions related to compliance, status and standards

  • http download resources
  • invalid http status codes
  • schema compliance
  • soap fault

 Script assertion feature

  • Groovy script to verify the contents
  • allows different operations before and after executing test cases
  • asserts dynamic response content
  • allows crating user defined assertion
  • consist of tear down method

 Assertion related to JMS and JDBC

  • JMS
    • JMS status- request test step to check and validate for executed or not
    • JMS timeout- contain jms endpoint
  • JDBC
    • JDBC status- work with JDBC test steps
    • JDBC timeout- work with JDBC test steps

 


Soup UI -Test suits, Test cases, SOAP vs Rest, Features

SoapUI

  • SoapUI is agile testing tool
  • Popular advance api testing tool
  • Support various protocol
  • Open source tool
  • Automate functional and non functional testing
  • Platform and language independent
  • Auto mock creation

 Important SoapUI features

  • Extends http for xml messaging
  • Drag and drop test creation
  • Supports for test debugging
  • Supports multiple environments- protocols-soap,rest including data driven testing
  • Increase test coverage

 WSDL

  • Web service description language
  • Xml based definition language
  • Soap based services testing oriented files
  • Defines various aspects of SOAP messages
    • Whether elements or attibutes are allowed to appear multiple times
    • Required or optional elements and attributes
    • Specific order of elements

 WSDL

  • Webservices breaks in 3 category
  • Input, output and map
  • Elements of WSDL
    • Types- data types
    • Operations -accept and transition-naming message, message queue
    • Binding
  • Pattern of operation
    • One way
    • Request- response
    • Solicit-response
    • Notifications

 Tips to test web service login

  • SQL injection tests
  • Log in and log in again
  • Lockout
  • Element duplication

 API testing with SoapUI

  • Create soap project
  • Enter WSDL  and under it various APIs
  • Right click WSDL and create test suite select APIs and ok
  • Test suits contains list of test cases with name of APIs
  • Expand test case > test steps> click on request

 Initialization of project

  • File>new soap project or click soap icon
  • Enter project name and WSDL (uri)
  • Under the project having green arrow WSDL file and under that various APIs and requests

 Adding WSDL to project

  • Specify the initial WSDL
  • Rename project
  • Click ok

Create test suits

  • Expand project> contains WSDL file>list of APIs
  • Right click on WSDL file > generate test suite and click ok
  • Rename the test suite

 REST API

  • Soap is protocol designed before rest
  • Soap works on different platform, while design specific to media components
  • Webservices defined as platform on rest
  • Rest supports get, push put and delete
  • File>new rest project will create new rest project> enter URI of API- uniform resource identifier