Thursday 31 December 2015

SQL query to extract all manual test cases from HP ALM

If  you have used HP ALM tool to store your test cases and when you want to download all test cases in one excel file at the end then it's not so easy to do that activity.

We can overcome that with below sql query by running in Analysis dashboard tab with Excel Report option in ALM.
This activity has to be completed in 2 phases.

1. To get absolute path of folder from where you would like to download test cases.
'''--- to get folder absolute path---
SELECT  AL_DESCRIPTION, /* Level3 Folder Name */ AL_ABSOLUTE_PATH
FROM All_Lists Where AL_ABSOLUTE_PATH

2. Place the absolute path extracted from the above SQL query in below


'''''---- to extract test cases from specific to folder
SELECT
TEST.TS_TEST_ID as "Test ID" /*Test.Test ID*/,
TEST.TS_NAME as "Test Name" /*Test.Test Name*/,
TEST.TS_STATUS as "Status" /*Test.Status*/,
TEST.TS_USER_27 as "Priority" /*Test.Test Case Priority*/,
TEST.TS_USER_44 as "Module" /*Test.Module*/,
ALL_LISTS.AL_DESCRIPTION as "Folder Name" /*Test Plan Folder.Name*/,
TEST.TS_RESPONSIBLE as "Tester" /*Test.Designer*/,
TEST.TS_DESCRIPTION as "Test Description"/*Test.Description*/,
DESSTEPS.DS_STEP_NAME as "Test Step Name" /*Test Step.Step Name*/,
DESSTEPS.DS_DESCRIPTION as "Step Description"/*Test Step.Description*/,
DESSTEPS.DS_EXPECTED as "Expected Results" /*Test Step.Expected*/
From TEST
Join ALL_LISTS On TEST.TS_SUBJECT = ALL_LISTS.AL_ITEM_ID
Join DESSTEPS On TEST.TS_TEST_ID=DESSTEPS.DS_TEST_ID
Where All_Lists.AL_ABSOLUTE_PATH like'AAAAAPAAAAAK%'
ORDER BY TEST.TS_TEST_ID, DESSTEPS.DS_STEP_ORDER



Wednesday 30 December 2015

HP UFT/QTP issue while performing action on object/element in the application

Have you ever observed an issue when UFT has an object in OR and it is able to recognize during execution but when we try to execute that line there is no action performing on the application

Ex: There is a link on the application and Object for that link is available in the Object Repository
Browser("BN").Page("PN").Link("LN").Click

This object is getting identified by highlighting it and also during the debug mode object is exist. But when we execute above line it is not performing actual action. At the same when we do this action manually it is working fine.

The reason behind is these kind of objects required special care to execute. Usually UFT/QTP executes the scripts by taking over the browser application controls. It is required to ask UFT to use Keyboard/Mouse action as user does manually.

In UFT, we have 2 options to execute scripts
1. Taking over the browser controls
2. Use Keyboard or Mouse contol

UFT by default uses approach as taking over the browser controls directly and performing the script execution. Apparently we have to change execution mode from default to Keyboard/Mouse control mode

Below piece of code does this job for us

Setting.WebPackage("ReplayType") = 2 'Mouse/keyboard mode
Browser("BN").Page("PN").Link("LN").Click

When you done this job you can move back to your previous mode again with below link of code
 Setting.WebPackage("ReplayType") = 1 'UFT mode

I hope this will help us to resolve such issues. Your comments are welcome :)

Tuesday 29 December 2015

Making HP UFT/QTP compatible with Chrome - Manually installing UFT add-on over Chrome browser



First and foremost  step we have to follow to make UFT compatible with Chrome is to check Browser support matrix. Please refer the link to check compatibility Link

Sometimes though Chrome version falls in support matrix list, UFT couldn't identify objects. 
There could be 2 reasons. 
1. Any left over UFT Add-ons available from previous versions
2.UFT installation not done properly and hence no UFT add-on installed on Chrome browser.
In both cases below solution works. Please refer this.

The steps to manually install Web Add-in Agent for Chrome are:
  
  1. Locate the Agent.crx to install.

    Note: If installing default version offered by presently installed QuickTest Professional (QTP) / Unified Functional Testing (UFT), search under <QTP/UFT>\bin\Chrome

    For Example: C:\Program Files (x86)\HP\Unified Functional Testing\bin\Chrome 
  2. Create a copy of the Agent.crx file you see in the above folder and rename the copied file extension to Agent.zip (Keep the copied file in the same folder as the Agent.crx file) 
  3. Extract Agent.zip to a folder called Agent 
  4. Verify that the above steps ran correctly 
    1. Your <UFT_INSTALLATION_FOLDER>\bin\Chrome folder should now look like:
       
    2. The folder <UFT_INSTALLATION_FOLDER>\bin\Chrome\Agent should include the following file/directory:
      1. Agent [Directory]
      2. Manifest.json 
  5. Start Chrome
  6. Access the Extensions listing:
    1. Navigate to the URL: chrome://extensions

      Or...
    2. Go to Chrome menu (ALT+F) > Tools > Extensions 
  7. (Important) If there is already a present QuickTest Professional (QTP) / Unified Functional Testing (UFT) Agent extension remove it
    Restart Chrome
  8. Ensure Agent is not listed under "Extensions"
  9. Enable Developer Mode by checking the “Developer Mode” option in the Extensions page
  10. Click on the “Load unpacked extension” button. 
  11. In the “Browse For Folder” dialog, select the folder <UFT_INSTALLATION_FOLDER>\bin\Chrome\Agent (same folder that was created in Step 3)  
  12. Confirm the new extension by clicking the “Add” button in the “Confirm New Extension” dialog
  13. You should now see the Unified Functional Testing Agent extension in the Chrome Extensions list
     
  14. Restart Chrome (This step is very important!)
Note: If you encounter a popup after starting Chrome, make sure you click on Cancel (or you can simply ignore it). Do NOT click on Disable.

HP UFT/QTP to make compatible with Mozilla

If you are having issues with UFT/QuickTest Professional recognizing Firefox, it could be because the patch installation was not able to make the appropriate modifications in the Program Files directory due to security restrictions presented by Windows7 (even if you have Administrator rights).  In this case you have to make the changes yourself with Administrative rights, and manually modify the directory and approve the security warning dialog boxes.

Getting QuickTest Pro and Firefox to work together is not difficult, but you do have to perform a couple of system modifications.  This post will discuss getting QTP v12.02 to work with Firefox up to v33 on Windows7.

Environment:
Windows7, QTP v12.02 2, Firefox up to version 33

Steps so that Firefox sees QTP:
1.Open Windows Explorer
2.Navigate to the folder where your QuickTest Pro is installed and expand the following folder underneath it: <QTP Installation>binMozilla
3.You should see a structure like in the image below.  Notice how there is now a sub-directory called “Common” with the new supported Firefox versions.QTP Directory


4.Now click on the “Common” directory and you will see a file called “install.rdf”, open this file in Notepad.
5.In the “install.rdf” file you want to copy the “em: id” under the top section which is specifying QuickTest Professional (I highlighted it in this image; do not confuse it with the “em: id” in the bottom section which relates to Firefox itself).Install RDF

6.Open another Notepad window and save it using the “em: id” from the step above as the file name (do not save it with an extension).  Now paste the full directory name to the “common” directory where QTP is installed in the contents of this new file.  The directory should look something like “C:Program FilesHPQuickTest ProfessionalbinMozillaCommon”.
7. Save the file and close it.  (It’s easier to do this process in a temporary directory due to security in Windows7, instead of in the final directory.)
8. In Windows Explorer, navigate to the folder where Firefox is installed (on my system that is “C:Program Files (x86)Mozilla Firefox”) and click on the sub-directory called “extensions”.
9.Now perform a click and drag of the file you created above in the temp directory, into this “extensions” directory.  Windows7 will prompt you with a security dialog box saying you have to have Administrator rights to do this.  Click the Continue button as long as you do (this whole process will only work if you are logged into your machine with Administrator rights).Firefox Directory

10. Now open the Firefox browser. Go to Tools -> Add-ons and you should now see the “QuickTest Professional X.X Plugin” is enabled.Firefox Addons
11. In Firefox, navigate to Google.
12.With QuickTest Pro, open the Object Spy and spy on the google search edit field.  QTP should now see the objects in your Firefox browser. In case the object is still identified as Window, make sure your firefox version is supported by the current UFT/QTP version

Wednesday 23 December 2015

How to Disable Startup Programs in Windows

The more software you install on your computer, the longer it may seem to take to start up Windows. Many programs add themselves to the list of programs started when you boot your computer, and that list can get long.

Editor’s Note: Obviously our more geeky readers already know how to do this, but this article is meant for everybody else. Feel free to share it with your non-techie friends!

If you are using Windows 8 or Windows 10, scroll down.

Disabling Startup Programs in Windows 7, Vista, or XP

For some programs, it’s smart to have them start with Windows, such as anti-virus and firewall software. However, for most programs, starting them at boot-up just wastes resources and extends startup time. There is a tool installed with Windows, called MSConfig, that allows you to quickly and easily see what’s running at startup and disable the programs you prefer to run on our own after startup as needed. This tool is available and can be used to disable startup programs in Windows 7, Vista, and XP.

NOTE: MSConfig can be used to configure several things other than just startup programs, so be careful what you do with it. If you’re not sure about using it, just follow the steps in this article and you should be fine.

To run MSConfig, open the Start menu and type “msconfig.exe” (without the quotes) in the Search box. As you type, results display. When you see “msconfig.exe,” click on it or press Enter, if it is highlighted.

NOTE: If you are using Windows XP, open the Run dialog box from the Start menu, type “msconfig.exe” in the Open edit box, and click OK.
Click the Startup tab on the System Configuration main window. A list of all the startup programs displays with a check box next to each one. To prevent a program from starting up with Windows, select the check box next to the desired program so there is NO check mark in the box. Click OK once you have made your choices.
A dialog box displays telling you that you may need to restart your computer for the changes to take affect. Click Restart to restart your computer immediately. If are not ready to restart your computer, click Exit without restart.

Tuesday 15 December 2015

Regular Expression in UFT

Regular expression is a string to search for complex phrase.

When there is sentence which has lot of words with special characters etc in it and it is keep on changing, so it is very difficult to adopt those changes in UFT (in Object Repository/ in Script) to overcome that issue we can use Regular expressions to search for that.

Below is technical issue I come across when I was working in the project
Object property value: Testing? please use Dev 123456 environment
and Dev 123456 number changes dynamically.

my solution for this: Testing.*\W.*

As in the above property value there is ? special character which is also can be used match with regular expression and hence it doesn't recognize entire text phrase.

Here \W try to match any non-word character. Equivalent to "[^A-Za-z0-9_]".
and .* try to match any zero or more characters

Below is few details I have given for various characters which can be used in regular expression to match our phrase.

Symbol Description
Alphanumeric Matches alphabetical and numerical characters only.
\n Matches a new line.
\[ Matches [ literal only
\] Matches ] literal only
\( Matches ( literal only
\) Matches ) literal only
\t Matches horizontal tab
\v Matches vertical tab
\| Matches | literal only
\{ Matches { literal only
\} Matches } literal only
\\ Matches \ literal only
\? Matches ? literal only
\* Matches * literal only
\+ Matches + literal only
\. Matches . literal only
\b Matches any word boundary
\B Matches any non-word boundary
\f Matches a form feed
\r Matches carriage return
\xxx Matches the ASCII character of an octal number xxx.
\xdd Matches the ASCII character of an hexadecimal number dd.
\uxxxx Matches the ASCII character of an UNICODE literal xxxx.


[xyz] Match any of the character class enclosed within the character set.
[^xyz] Matches any of the character class that are NOT enclosed within the character set.
. Matches any character class except \n
\w Match any word character class. Equivalent to [a-zA-Z_0-9]
\W Match any non-word character class. Equivalent to [^a-zA-Z_0-9]
\d Match any digit class. Equivalent to [0-9].
\D Match any non-digit character class. Equivalent to [^0-9].
\s Match any space character class. Equivalent to [ \t\r\n\v\f]
\S Match any space character class. Equivalent to [^\t\r\n\v\f]


* Matches zero or more occurrences of the given regular Expression. Equivalent to {0,}.
+ Matches one or more occurrences of the given regular Expression. Equivalent to {1,}.
? Matches zero or one occurrences of the given regular Expression. Equivalent to {0,1}.
{x} Matches exactly x number of occurrences of the given regular expression.
{x,} Match atleast x or more occurrences of the given regular expression.
{x,y} Matches x to y number of occurences of the given regular expression.


0 Grouping a clause to create a clause. "(xy)?(z)" matches "xyz" or "z".
| Alternation combines one regular expression clause and then matches any of the individual clauses. "(ij)|(23)|(pq)" matches "ij" or "23" or "pq".


"^\s*.." and "..\s*$" Represents that there can be any number of leading and trailing space characters in a single line.
"((\$\s?)|(#\s?))?" Represents an optional $ or # sign followed by an optional space.
"((\d+(\.(\d\d)?)?))" Represents that at least one digit is present followed by an optional decimals and two digits after decimals.

Sunday 13 December 2015

HP LeanFT - Desktop Automation - C# Script

Below is the sample code generated from LeanFT with M.S. Visual Studio tool on FileZilla application.


            Desktop.Describe<IWindow>(new WindowDescription
            {
                Text = @"FileZilla"
            }).Describe<HP.LFT.SDK.StdWin.IEditField>(new HP.LFT.SDK.StdWin.EditFieldDescription
            {
                AttachedText = @"&Username:",
                NativeClass = @"Edit"
            }).SetText("test");

            Desktop.Describe<IWindow>(new WindowDescription
            {
                Text = @"FileZilla"
            }).Describe<HP.LFT.SDK.StdWin.IEditField>(new HP.LFT.SDK.StdWin.EditFieldDescription
            {
                AttachedText = @"&Host:"
            }).SetText("10.22.33.44");

            Desktop.Describe<IWindow>(new WindowDescription{Text = @"FileZilla"}).Describe<HP.LFT.SDK.StdWin.IEditField>(new HP.LFT.SDK.StdWin.EditFieldDescription
            {AttachedText = @"Pass&word:"}).SetSecure("566d4b0d9f90740f8d533a7d91dde4b001c07aee");

            Desktop.Describe<IWindow>(new WindowDescription
            {
                Text = @"FileZilla"
            }).Describe<HP.LFT.SDK.StdWin.IButton>(new HP.LFT.SDK.StdWin.ButtonDescription
            {
                Text = @"&Quickconnect"
            }).Click();

IBM Greehat / Rational Integration Tester issue while launching - An error has occurred. See the log file

When you installed HP UFT/LeanFT after installing IBM GreenHat/Rational Integration Tester then it gives an error "An error has occurred. See the log file" and doesn't launch the tool.



It is solely because of HP UFT/LeanFT tool, as it creates few variables in environment variables list which causes an error.

To resolve that issue, we have to delete below list of variables.

  • _JAVA_OPTIONS
  • IBM_JAVA_OPTIONS
  • JAVA_TOOL_OPTIONS
This issue is not only for IBM tools but also for eclipse tool to open,

Saturday 12 December 2015

Worksoft Certify - Automation Testing tool Introduction

Worksoft Certify is functional automation testing tool which supports wide variety of technologies(SAP, Web, .Net, Java..etc). However this tool mostly uses for SAP ERP applications.

This tool provides most powerful script-less automation in effective way. It also supports integrating with SAP Solman, BPCA, HP ALM..etc.

This tool supports almost all features available in any other well known functional testing tool(like HP UFT, RFT..etc). Because of user friendly in nature this tool can be used by anybody with minimal training as it doesn't require programming language.

Please watch below short video for a glance on Worksoft Certify.

https://www.youtube.com/watch?v=b7KsMSxI8pw

HP LeanFT Introduction - Visual Studio C# script creation video

HP LeanFT helps us to perform automation testing more robust way. It's a plug in and can be installed on top of Eclipse or Visual Studio IDEs.

Rather then upgrading the core HP UFT functionality(VB Script and Object Repository) HP has launched LeanFT tool to support Object Oriented Language(Jave/C#).

LeanFT supports below technologies with Eclipse/Microsoft Visual Studio IDE

  • Web
  • WPF
  • WinForms
  • StdWin
  • SAPUI5
  • SAP
  • Java

For integration and creating C# script with LeanFT, Please watch short video with URL:
https://www.youtube.com/watch?v=r4968qn8qFE

Monday 7 December 2015

Passing current date value in a variable with SAP CBTA tool

As you know SAP CBTA is script less automation testing tool and it is required lot of CBASE understanding in order to work with custom coding.
Without touching backend code, below option reveals us how we can pass current date value during the script execution.

Below are the steps to follow:
  1. Open the recorded CBTA Script
  2. Edit the date it captured
  3. Replace hard code date value with %=day(now())&"."&month(now())&"."&year(now())%
  4. Save it and run the script
if you want to make any changes like adding 1 day/ couple of months/ year advanced date then you can simply add +1(number) next to your period.
Example:
I have to enter 2 days advance date

%=Day(Date+2)%.%=Month(Date)%.%=Year(Date)%
I have to enter 1 month advance date

%=Day(Date)%.%=Month(Date+1)%.%=Year(Date)%
I have to enter 1 year previous date
%=Day(Date)%.%=Month(Date)%.%=Year(Date-1)%