QTP did not release any updates for almost two years. Any guess, whether HP is going to come with any different release altogether or coming up with new tool...
See the release history below...
11.0 - Released in 2010
10.0 - Released in 2009
9.5 - Released in 2008
9.2 - Released in 2007
9.1 - Released in 2007
9.0 - Released in 2006
8.2 - Released in 2005
8.0 - Released in 2004
source: Wikipedia - QuickTest Professional
Sunday, April 8, 2012
QTP New Version?
Sunday, March 25, 2012
Robot Framework - TypeKey Library
Implemented a library to simulate keyboard events. It can be used for upload and download operations along with Selenium.
TypeKeyLib - Library
#
# Purpose: Test library to simulate keyboard actions.
#
import time
import sys,os
import win32api, win32con
from win32com.client import Dispatch
from robot.errors import DataError
from robot import utils
__version__ = '0.1' # Developed by Palani
class TypeKeyLib:
ROBOT_LIBRARY_SCOPE = 'GLOBAL'
ROBOT_LIBRARY_VERSION = __version__
def __init__(self):
""" TypeKeyLib Library can be imported with optional arguments
"""
self._result='Init'
# To do
def TypeKeys(self,sKey):
""" TypeKeys - used to simulate keyboard keys. Parameter sKey can be STRING or LIST
For Key representation, see at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/wsmthsendkeys.asp
"""
try:
self._result='TypeKeys method'
shell=Dispatch("WScript.Shell")
stype = type(sKey).__name__
#print 'Given type: ', stype
if (stype == 'list'):
# Execute multiple times
for key1 in sKey:
shell.SendKeys(key1)
time.sleep (0.5)
else:
# Execute only one time
shell.SendKeys (sKey)
time.sleep(1)
#shell=Nothing
self._result='pass'
except:
self._result='fail'
print '*INFO* Exception occurs: ', sys.exc_type , ":", sys.exc_value
raise
finally:
self._result+= ' done'
return self._result
def TypeKeys_Space(self):
""" TypeKeys_Space - used to simulate SPACE.
"""
self.TypeKeys (" ")
Sunday, March 18, 2012
Robot Framework - Database Libraries
Robot framework already has two database libraries and both are implemented in different lanugauges.
Database Library - Java
Database Library - Python
I have developed two simple database libraries. One is for generic ODBC interface and another one is especially for Oracle. The second one can be used as thin client.
Database Library - ODBC interface
# Author: Palani Selvam
#
# NOTE: It is supported all type of Databases, which are having support to ODBC
# For ex, DB2, ORACLE, MS SQL SERVER, Sybase.
#
import pyodbc as DB
from robot.errors import DataError
from robot import utils
__version__ = '0.1' # Developed by Palani - 20101022
class DBLibrary:
ROBOT_LIBRARY_SCOPE = 'GLOBAL'
ROBOT_LIBRARY_VERSION = __version__
def __init__(self):
"""DBLibrary Library can be imported with optional arguments.
"""
self._connection = None
self._default_log_level = 'INFO'
self._bexception = False
#self._prompt = prompt
def make_connection(self, sDsn, sUid=None, sPwd=None):
""" make_connection method is used to create the connection object.
sDsn - DataSource Name
sUid - User Id to access the database
sPwd - Password to access the database
"""
sConn = None
try:
sConn = DB.connect(dsn=sDsn, uid=sUid, pwd=sPwd )
except Exception:
self._bexception = True
print 'Connection for database has failed', Exception
raise
finally:
self._connection = sConn
def execute_sql (self,sSql=None,iRows=None):
""" execute_sql method is used to execute the sql query to the given connection object.
sSql - Query to access the database
iRows - No of rows to be returned.
"""
sOut = None
sCursor = None
sConn = self._connection
if (sConn == None) :
return sOut
else:
try:
sCursor = sConn.cursor()
sCursor.execute(sSql )
# curs.execute("SELECT * FROM EmpTable WHERE SCOPE=3 ")
if (iRows <> None) :
iRows = int (iRows)
sOut = sCursor.fetchmany (iRows)
else :
sOut = sCursor.fetchall ()
except Exception:
self._bexception = True
print 'Query execution is failed. ', Exception
raise
finally:
if (sCursor <> None):
sCursor.close ()
return sOut
def execute_for_one_row (self,sSql=None):
""" execute_for_one_row method is used to execute the sql query and returns only first row.
sSql - Query to access the database
"""
sOut = None
sCursor = None
sConn = self._connection
if (sConn == None) :
return sOut
else:
try:
sCursor = sConn.cursor()
sCursor.execute(sSql )
rows = sCursor.fetchone ()
for sOut in rows:
break
except Exception:
self._bexception = True
print 'Query execution is failed. ', Exception
raise
finally:
if (sCursor <> None):
sCursor.close ()
return sOut
def disconnect_from_database (self,sConn=None):
""" disconnect_from_database method is used to disconnect from the given connection object.
sConn - Connected Object, which is got through make_connection method.
"""
if (sConn <> None):
sConn.close ()
else:
self._connection.close ()
Database Library - Oracle
# Author: Palani Selvam
#
#
# NOTE: It is supported only ORACLE Databases
# DSN is not required.
#
import cx_Oracle as DB
from robot.errors import DataError
from robot import utils
__version__ = '0.1' # Developed by Palani
class ORADBLibrary:
ROBOT_LIBRARY_SCOPE = 'GLOBAL'
ROBOT_LIBRARY_VERSION = __version__
def __init__(self):
"""DBLibrary Library can be imported with optional arguments.
"""
self._connection = None
self._default_log_level = 'INFO'
self._bexception = False
#self._prompt = prompt
def ora_make_connection(self, sConnString):
""" make_connection method is used to create the connection object.
sConnString - Connection String
Example:
'sqluser/welcome@127.0.0.1/orcl'
"""
sConn = None
try:
sConn = DB.connect(sConnString )
except Exception:
self._bexception = True
print 'Connection for database has failed', Exception, sConnString
raise
finally:
self._connection = sConn
def ora_execute_sql (self,sSql=None,iRows=None):
""" execute_sql method is used to execute the sql query to the given connection object.
sSql - Query to access the database
iRows - No of rows to be returned.
"""
sOut = None
sCursor = None
sConn = self._connection
if (sConn == None) :
return sOut
else:
try:
sCursor = sConn.cursor()
sCursor.execute(sSql )
# curs.execute("SELECT * FROM EMP_Table WHERE SCOPE=3 ")
if (iRows <> None) :
iRows = int (iRows)
sOut = sCursor.fetchmany (iRows)
else :
sOut = sCursor.fetchall ()
except Exception:
self._bexception = True
print 'Query execution is failed. ', Exception
raise
finally:
if (sCursor <> None):
sCursor.close ()
return sOut
def ora_execute_for_one_row (self,sSql=None):
""" execute_for_one_row method is used to execute the sql query and returns only first row.
sSql - Query to access the database
"""
sOut = None
sCursor = None
sConn = self._connection
if (sConn == None) :
return sOut
else:
try:
sCursor = sConn.cursor()
sCursor.execute(sSql )
rows = sCursor.fetchone ()
for sOut in rows:
break
except Exception:
self._bexception = True
print 'Query execution is failed. ', Exception
raise
finally:
if (sCursor <> None):
sCursor.close ()
return sOut
def ora_disconnect_from_database (self,sConn=None):
""" disconnect_from_database method is used to disconnect from the given connection object.
sConn - Connected Object, which is got through make_connection method.
"""
if (sConn <> None):
sConn.close ()
else:
self._connection.close ()
Sunday, February 12, 2012
RobotFramework Standards
RobotFramework team has given guidelines --> HowToWriteGoodTestCasesWithExamples. Similar to coding standards, Automation team should use certain guidelines for Keyword-Driven framework also. It would be more useful to functional team as well as other teams.
Test Suite / Script
- Test Script names should be less than 20 characters and file type should be HTML.
- It should be easily readable and self-explanatory.
- Remember that suite names are created automatically from file/directory names. Extensions are stripped, underscores are converted to spaces and, if name is all lower case, words are capitalized. For example login_tests.html -> Login Tests and DHCP_and_DNS -> DHCP and DNS.
- Documentation should be updated with purpose of the script and pre-conditions.
- Proper keywords should be given for Suite Setup, Suite Teardown, Test Setup and Test Teardown.
- Should not have too many tests (max 50) in one suite unless they are data-driven.
TestCases / Tests
- Test case names should be less than 40 characters and file type should be HTML.
- Test case Name should be in camel case (In a word, First letter is capital and remaining letters are in small).
- It should be easily readable and self explanatory.
- Documentation should be updated with manual test case steps, notes and pre-conditions.
- Proper keywords should be given for Suite Setup, Suite Teardown, Test Setup and Test Teardown.
- Appropriate tags should be given for each case.
- Tests should be independent.
- In dependant tests, detailed notes should be given. Consider verifying the status of the previous test using ${PREV TEST STATUS} variable.
- Hard coding of object name should be avoided.
- Should contain many high level keywords instead of repeating steps often.
- High level keywords should be used for navigation.
- Local variables should have prefix char ‘t’ as temporary variables
Resources
- Keep all resource files in single folder.
- Resource file names should be less than 20 characters and file type should be HTML.
- All characters should be small characters.
- Documentation should be updated with purpose.
- All constants should be maintained in separate resource file.
- Keep separate resource files for application’s data.
- Keep separate resource files for all GUI objects page wise or module-wise.
- Group the high level keywords by categories like business logic, module and general.
High Level Keyword / User Keyword / Function
- Function names should be less than 35 characters.
- It should be easily readable and self explanatory.
- For easy readability, it should be in camel case (Capital & Small letters).
- Prefixes are sometimes useful. For example, Is - to ask a question about something, Get - get a value, Set - set a value
- Can have space for better readability.
- Documentation should have clear details for purpose, variables and returning values.
- Hard coding of object name should be avoided.
- Arguments should have char ‘p’ as prefix and returned variable should have char ‘r’ as prefix.
- Local variables should have prefix char ‘t’ as temporary variables
- Duplicate Functions should not be added.
- Can contain some programming logic (for loops, if/else)
- Complex logic in libraries rather than in user keywords
- Important variables can have comments on the RHS
Variables
- Variable names should be less than 20 characters.
- Variables should have meaningful words
- For easy readability, it should be in camel case (Capital & Small letters).
- Local variables should have prefix char ‘t’ as temporary variables
- Arguments should have char ‘p’ as prefix and returned variable should have char ‘r’ as prefix.
- GUI object variables should have char ‘o’ as prefix.
- Constant variables should be in Capital letters. For example, APP_URL, DB_SERVER. All other type of variables should have mixed style (small and capital) characters.
- Script/Global variables should be defined at the top of the script.
- Function / test case level variables should be defined at top of the function.
- Can have space. But try to restrict for minimum
Monday, January 30, 2012
Performance Testing Guidance from Microsoft
I always admire Microsoft for its documentation. Right from OS to Office applications, you can find good documentation. Microsoft has shared very good articles for performance testing and tuning.
You can find more articles related to Performance testing available from
Patterns & Practices: Performance Testing Guidance . Just listed only How-TOs part. Thanks to Microsoft!!!
Performance Testing
- How To: Conduct Performance Testing Core Steps for a Web Application
- How To: Determine Performance Testing Objectives
- How To: Conduct Performance Testing
- How To: Conduct Performance Testing with Automated Load Testing Tools
- How To: Manage The Performance Test Cycle_Agile
- How To: Manage The Performance Test Cycle_CMMI
- How To: Consolidate Various Types of Performance Acceptance Criteria
- How To: Coordinate Performance Testing With an Iteration Base Process
- How To: Evaluate Systems to Improve Performance Testing Effectiveness
- How To: Quantify End-User Response Time Goals
- Explained: Types of Performance Testing
- Explained: Key Mathematic Principles for Performance Testers
Capacity
- How To: Capacity Plan for Web Applications Using Transaction Cost Analysis
- How To: Capacity Plan for Web Applications Using Predictive Analysis
Load Testing
- How To: Load Test Web Applications
- How To: Step Through Creating a Load Test in Visual Studio Team System
- How To: Load Test Web Applications Using Visual Studio Team System
- How To: Use Data Binding in Load Tests in Microsoft Visual Studio Team System
Stress Testing
Test Cases/Scripting
- How To: Control the Number of Load Test Iterations in Visual Studio Team System
- How To: Create a Load Test Plug-In using Visual Studio Team System
- How To: Correlate Dynamic Data in a Load Test Transaction
- How To: Programmatically Set Think Time Between Test Iterations in Visual Studio Team System
Troubleshooting
- How To: Identify Functions Causing High CPU
- How To: Identify a Disk Performance Bottleneck Using SPA
Tuning
Workload Modeling
- How To: Use IIS Log Files In Performance Testing
- How To: Model the Workload for Web Applications
- How To: Model the User Experience from Web Server Logs
- How To: Model User Delays and Think Times
- How To: Account for User Abandonment
- How To: Model Application Usage without Empirical Data
- How To: Model an Application Usage
Hope all these links would be useful..
Sunday, January 29, 2012
JVM Monitoring
Couple of our applications are using Tomcat server. JMeter was used as load testing tool. To monitor Java memory, I used two options. One is JMX(Java Management Extensions) console and Psi-Probe.
To implement those options, you should add following entries into catalina.sh
-Dcom.sun.management.jmxremote.port=9005 \
-Dcom.sun.management.jmxremote.ssl=false \
-Dcom.sun.management.jmxremote.authenticate=false
To access JMX console,Enter command ==> [java_installation]\bin\jconsole hostname:port
To use Probe, you need to deploy in tomcat server instance and then access the probe application.
Sunday, December 4, 2011
Skills for Performance Testing
Earlier I have written about Skills for Automation. Here I attempted to write about the skills for Performance Testing. Because performance testing is very dynamic and has vast areas in different technologies and concepts. It requires different level of of depth knowledge depends on project requirements and environment. It required different technical and non-technical stuff on the job.
Skills for Performance Testing
- Analytical skills
- Scripting
- Operating System Concepts
- Networking concepts
- Memory Management concepts
- Database Concepts
- Hardware concepts
- Protocols concepts
- Debugging
- Log Analysis
- Documentation
Suggesting following links...
SQAForums's post - Need opinion from exp. load testers- skillset
Technical Skills For Performance Testers
What Skills Performance Testers Need and How to Get Them?
Saturday, November 26, 2011
JMeter - JDBC Driver issue
I was trying JDBC query execution through JMeter. I was getting the error like java.sql.SQLException: No suitable driver found . I have given ojdbc6.jar on classpath and installed Oracle client. Still JMeter has thrown error. The solution is, ojdbc6.jar should be copied under JMeter Lib folder (<JMeter installation directory>\lib).
Later, the same script was copied into a server and executed the script. Got the same error. Server does not have Oracle client installation and ojdbc6.jar in JMeter lib folder. Just copied the ojdbc6.jar and able to run the script successfully.
Note:
ojdbc6.jar should be used for Oracle 11 version. Also it is supported only Java1.5 and above.
Sunday, October 2, 2011
FOR loops & IF condition in RobotFramework
Using Robot Framework, test engineer can create FOR loops and IF conditions. I don't think so, any other Keyword driven framework is giving this kind of flexibility.
FOR loop can be set in two ways. First one is based on number of items in a List. Another one is based on range like from 1 to 50. Similarly keywords can be executed if condition matches or not. See below example.
FOR Loop & IF condition explantation using Robot Framework
| TestCase | Action | Arguments | ||
|---|---|---|---|---|
| VerifyListItems | [Arguments] | ${Locator} | @{ListItems} | |
| [Documentation] | Verifies the list of items present in a List Object. | |||
| : FOR | ${Element} | IN | @{ListItems} | |
| Select From List | ${Locator} | ${Element} | ||
| List Selection Should Be | ${Locator} | ${Element} | ||
| : FOR | ${index} | IN RANGE | 50 | |
| ${obj1}= | Evaluate | ${index}*4+3 | ||
| Run Keyword if | '@{tDriverData}[4]'=='2' | Go To MyProfile | ||
| Run Keyword Unless | '@{tDriverData}[4]'=='2' | Go To UserCreation | ||
Monday, August 15, 2011
Robotframework Installation
RobotFramework Installation is a tricky task. We need to install 6-7 utilities. All should be installed in the same order. Here I have given the instructions for Windows OS.
Tools installation
All RobotFramework related software can be the latest. The other software should be as the same version.
- Install Python (python-2.6.4.msi). Set installation directory as C:\Python26
- Install Robot Framework (robotframework-2.6win32.exe)
- Install Robot Selenium Library (robotframework-seleniumlibrary-2.7.win32.exe)
- Install Python Widgets (wxPython2.8-win32-unicode-2.8.11.0-py26.exe)
- Install Robot IDE (robotide-0.31.win32.exe)
- Install Python Win32 module (pywin32-214.win32-py2.6.exe)
- OPTIONAL (For SeleniumLibrary)- Install Java (jdk-6u14-windows-i586.exe), if your machine does not have Java.
- OPTIONAL (For SeleniumLibrary)- Extract Selenium RC Server (selenium-remote-control-1.0.3.zip)
Environment variables Configuration
To execute RIDE and Pybot, environment variables should set properly.
- Create a system level environment variable & value as --> PYTHONHOME=C:\Python26
- Create a system level environment variable & value as --> PYTHONPATH=C:\Python26\Lib;C:\Python26\Scripts;C:\Python26\Lib\site-packages;C:\Python26\Lib\site-packages\SeleniumLibrary;C:\Python26\Lib\site-packages\robotide\;C:\Python26\Lib\site-packages\robot\;C:\Python26\Lib\site-packages\wx-2.8-msw-unicode;
- Also add to PATH variable --> % PYTHONHOME%;% PYTHONHOME%\Scripts;
Steps for 64 Bit OS
To enable Robot Framework for 64 bit OS, you should install 64 bit python setup in same directory. Also the command prompt should be invoked through setting ‘Run as a Administrator’ if OS is Vista or Windows 7 version.
Verify the Installation
Open new command prompt and type ‘pybot --version’ and output like --> Robot Framework 2.6.0 (Python 2.6.4 on win32).