Automating Testing and Configuration Data Migration in … · in OTM/GTM Projects using Open Source...
-
Upload
phamkhuong -
Category
Documents
-
view
224 -
download
0
Transcript of Automating Testing and Configuration Data Migration in … · in OTM/GTM Projects using Open Source...
Automating Testing and Configuration Data Migration
in OTM/GTM Projects using Open Source ToolsBy
Rakesh Raveendran
Oracle Consulting
Agenda
•Need
•Desired End Picture
•Requirements Mapping
•Selenium Testing Tool
•Soap UI Testing Tool
•Apache Ant based config migration
•Q&A
Need for Automating Testing and
Configuration Data MigrationTesting
• Testing is never ending
• Team size varies
• Impact of Testing due to delays
• Accuracy
• Test Data Generation
• Load Testing and Performance Tuning
Configuration Data Migration
• Version control of Configuration data
• Selective Config Migration
• Multiple phases of projects
• New Modules
• GTM
• Fleet Management
Desired End Picture
Master
Domain*
Client
Domain
Client
DomainClient
Domain
DEV
UAT PROD
Extract From
Master DomainVersion Regression
Test Report
Update Client Domain
• Complete Config Migration
•Selective Config (Agent)
Migration
• Support Integration to Client Version Control tool to
version control config data
• Convert Master Domain Data to Client Domain and
Update
• Perform Regression
Testing
(Only in Test Environments)
•Agent Configuration
•Testing
• * Master Domain can also be maintained in a separate
server
Requirement and Tool Mapping
Requirement Tool What it Does Resource
• UI Testing Selenium Web UI Testing http://seleniumhq
.org/
• Data Driven UI Testing TestNG Data Driven Selenium Testing http://testng.org/
doc/index.html
•Integration Unit Testing
•Functional Testing
•Regression Testing
•Load Testing
SOAP UI Functional Testing/Integration Unit
Testing
http://www.soapu
i.org/
• Extracting Config Data
•Converting Config Data
from One Domain to
another
OTM Python Scripts Extracts data into CSV or XML
• Executing OTM python
scripts
•Integrating with client
Version Control Tool
•Executing automated test
suite (SoapUI,
Selenium+TestNG)
•Executing XSL
transformation to generate
customization report
•Converting data from one
domain to another
Apache Ant Build Automation Tool http://ant.apache
.org/
Selenium
• Selenium is a suite of tools to automate web testing
• Selenium has a IDE which is a Firefox add-on
• To install Selenium download and install the Firefox add-on from
seleniumhq.org
Selenium IDE
1. Record UI Actions to create
Test Case4. Control Speed
3. Option to create
multiple Test Cases
and group them
into Test Suite
5. Playback Test Suite for Testing
2. Option to Edit the Test Case
Selenium IDE
• Display the Result of Testing
• Tips for OTM• Try to use the direct
URL to finder screen
(Screen Set )to avoid
menu changes and
Selenium is more
efficient with single
Window than multiple
frame.
• Prefer “Always open
in same window” as
Selenium is not that
efficient with multiple
windows
• Introduce delays
using
setSpeed("500") and
use
waitForPageToLoad("
30000") and
“AndWait” actions
Selenium IDE script generation
• Export Test Case in a language of your choice Java,
Python, PHP, Ruby etc
Selenium RC + TestNG
• Selenium RC is a tool to run Selenium test case using
standalone scripts
• Supports Multiple Browsers and scripting language
• Test Case script template is generated using IDE
• TestNG is java and XML based Test Framework
• TestNG has standard functions for SeleniumRC
• Combination of SeleniumRC+TestNG ideal for Data
Driven testing( Data in Spreadsheet etc)
Data Driven Testing using Selenium
RC+Test NG<suite name="Suite" parallel="none">
<parameter name="selenium.host" value="localhost" />
<parameter name="selenium.port" value="1235" />
<parameter name="selenium.browser" value="*iexplore" />
<parameter name="selenium.url" value="http://consapp07/" />
<parameter name=“file.location" value=“c:/otm/test/" />
<test name="Test" preserve-order="false">
<classes>
• The TestNG program
uses Data from
spreadsheet and calls
Selenium
SoapUI
• Free and Open Source Functional Testing
Tool
• Started as a web service based SOA testing
tool
• Good graphical interface and powerful
features
• Wide user community
• Has licensed commercial version (SoapUIPro)
SoapUI for testing in OTM projects
• Leverage integration framework of OTM
• Can help OTM projects with the following
testing needs
• Integration Unit Testing
• Functional Testing
• Regression Testing
• Load Testing
Setup
• Import OTM/GTM WSDL file to create project
(OTM/GTM WSDL Can be obtained from Business Process
Automation > Integration > Integration Manager > Retrieve
WSDLs.
• You may have to Increase JVM memory for WSDL to
load
Note: The JVM parameter can be modified by editing the soapui.bat file under the bin folder and
editing the following line and making the change as highlighted in this case it is set to 2GB
set JAVA_OPTS=-Xms2g -Xmx2g -Dsoapui.properties=soapui.properties "-
Dsoapui.home=%SOAPUI_HOME%\"
SoapUI with Sample Test Case
Test Case
Enclose the OTM Transmission within a soap envelope
The Transmission should have the namespace (xmlns)properly
defined
Properties are used to generate key fields
Scripting in Soap UI
• Java based scripting language Groovy is used
• Helps with generating random numbers, dates and
other data to be used in testing
• Can also be used to read data from spreadsheet for
data driven testing
SoapUI Assertion
• Xpath and Xquery based assertion
• You can compare on status, cost, weight, volume etc
• You can also check if an element is present in XML
and the number of lines etc
SoapUI Report
• Report Using Commercial
SoapUIPro Version
• Basic Report using Free SoapUI
version
SoapUI for load testing
• Any Test Case can be configured to be load tested
• Right click on test case and click on new load test to start a load test
• The test
strategy
can be
changed
according
to
requirement
SoapUI for load Testing
WebserviceSoap UI
OTM Application Server
DB
• OTM Performance Reports(EventDiagnosticetc), top ,sar
AWR. ADDM, SQL Trace
SoapUI in OTM projects
• Create Unit Test Cases during Integration Mapping
• Test Case can be reused for Load Testing
• Data Driven Testing is possible with scripting
• MockService can be used for creating Test Stubs
• Link Unit Test cases already created to create
Functional Test Cases
• Use Topic Interface to execute Bulk Plan using
Integration
Configuration Migration using Apache
Ant
• ClientUtil.py OTM python script provides option to
extract and load data from OTM tables
• Uses ant scripts to call ClientUtil.py and uses
standard task available with ant for the following
• Integration to Version Control tool
• Integration to testing tool for regression testing
• Automating manual processes
Apache Ant
• Open source build automation tool
• Standard Tasks available to integrate with
Version Control tools and Testing Tools
• Has various standard tasks available to
automate manual process and execute scripts
• XML Build file is created with the logic to
automate the config migration
Setup
• Install Python and OTM Python Scripts (Refer
“Configuring Python on a Client PC” section in Admin
Guide)
• Install latest version of Apache
Ant(http://ant.apache.org)
• Install pyanttasks
(http://code.google.com/p/pyanttasks/)
• Create an ant build.xml file with the Configuration
tables to be exported and imported and other tasks
Sample Logic of the Ant Build File
• Run Ant Task’s to extract data from Master Domain
using OTM Scripts
• Run Ant task to clean up any table files which require
special handling like removing domain hardcoding etc
• Execute Ant Task to integrate with client version
control tool
• Run Ant Tasks to update transactional client domain
• Run XSLT using Agent data XML’s to get Documents
• -----------------Restart OTM-------------
• Execute automated test cases
Apache Ant Build File
Ant Task for importing and exporting
into a table
• Refer Data Management Guide for ClientUtil.py usage
Exporting Data Importing Data
Calling Version control and Testing
Tool using ant
• Calling Version control and Testing tool
Closing Thoughts
• Each of the Tools can be used by itself
• Evaluate Commercial Tools if you have option
• Put a process in place for automating testing
• Check license of open source tools if you are planning
to use them
• Have a long term view with testing requirement
• Each of the tools have lot of training material in the
internet (youtube.com has videos on how to use)