Thursday, July 24, 2014

UFT/QTP does not identify an Object

Here are some things to Try when UFT is not recognising objects

1. Open QTP/UFT first

While testing on any app, make sure QTP is opened first and then your application. QTP works by looking into your application. If you open QTP after your application has started there are chances that QTP may not be able to identify objects

2. Load Relavant Add-ins

Make sure you have loaded ALL the relevant add-ins required for your Application Under Test (AUT).

3. Record and Run Settings

While working on web based applications, make sure Record and run test on any open browser is selected under Record > Record and run settings.

4. BHO (Browser Helper Object
) Manager
Make sure BHO Manager in IE under Tools > Manage Add-Ons > Enable or Disable Addons is enabled.

5. Enable Extensions

If you are working on Firefox or Google chrome browser, don’t forget to enable browser extensions.
In case of Firefox go to Firefox menu > Add-ons > Extensions and enable Unified Functional Testing Extension .
For Chrome go to Tools > Extensions and enable Unified Functional Testing Agent.


6. Disable Protected Mode

In IE, clear the Enable Protected Mode option under Tools > Internet Options > Security

7. User Account Control

UAC was introduced in Windows Vista and continued in Win 7 and Win 8/8.1. UAC can interfere with your application. It is a good idea to disable it while working on QTP.
  • To turn-off UAC in Windows 7, go to Start Menu > Search for “Change User Account Settings” > Disable UAC
  • To turn-off UAC in Windows 8/8.1, you need to take help of registry. UI setting doesn’t truly turns-off UAC in Win 8/8.1. Hit Win + R key, type regedit and click OK. Navigate toHKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\SystemFind the key: EbableLUA and change the Value Data value to 0
8. Zoom Level
Make sure the zoom level is set to 100% while testing in any browser. Check the illustration below on how zoom-level affects highlight object functionality in QTP. (Focus on the blinking black rectangle on the left once the Highlight button is clicked on the right.)

9. Object Notation
There are times when identification properties are not enough to identify an object. You may make use of native properties in that case. Use .object notation to locate the erring property. Make sure to correctly identify it.

10. Low Level Recording (click here for different recording modes in QTP)
After you have exhausted all options you can try Low level recording. It’s not a good method from maintenance point of view but it may come handy at times.

11. If your QTP worked well for some days or months and suddenly stopped identifying objects, that has happened probably there is some change in your browser or UFT software itself. Try to disable auto-updates on machines where QTP is installed.

12. If you’re testing cross browser, don’t use Type property to identify Webbutton class since the default value is different for IE (button) and Firefox (Submit).

13. If QTP was successfully able to identify object at record time but unable to identify the same object during replay time, there are chances that object properties are dynamic in nature. Make use of regular expression or parameterization to handle those dynamic values.

14. Make sure the version of QTP you use supports the version of your browser and/or your Windows operating system.

Also read, How to handle dynamically changing objects in UFT?

How to associate Function Libraries to test in QTP/UFT??

When you are creating QTP/UFT scripts or designing any Framework, you will need to associate Function Libraries to them. This can be done Manually or even through scripting.

Here I would like to show you both the ways of Associating a Function Library. The Association can be made in 4 ways.
  1. Using File-> Settings
  2. Using AOM
  3. Using ExecuteFile method
  4. Using LoadFunctionLibrary method

1. Using File->Settings

This is the common and manual method of associating the Function Library. Find below the step by step procedure of doing it

  1. After opening the Test, click on File menu
  2. Click on Settings under file menu. You can see a Window open with name Test Settings
  3. Here, click on the Resources on the left tab. You will see a new Frame in right showing Resources and a empty box below
  4. Here we can click on the plus (+) button and browse and select the function library we need to associate.
  5. After adding the libraries, click on Apply and OK.

2. Using AOM

AOM means Automation Object Model. This is a mechanism using which one can control various operations from outside the QTP. Using AOM, we can even write a code to open QTP test and associate Library Function.

    AOM to open QTP test
        'Open QTP
     Set objQTP = CreateObject("QuickTest.Application")
     objQTP.Launch
     objQTP.Visible = True
     'Open a test and associate a function library to the test
     objQTP.Open "C:AutomationSampleTest", False, False     

    AOM to associate a library

        Set objLib = objQTP.Test.Settings.Resources.Libraries
    'If the library is not already associated with the test case, associate it..
    'If library is not already added
    If objLib.Find("C:SampleFunctionLibrary.vbs") = -1 Then 
        'Associate library to test case
        objLib.Add "C:SampleFunctionLibrary.vbs", 1 
    End


3. Using ExecuteFile method


ExecuteFile statement executes all the VBScript statements present in the specified file, thus making all the functions, sub-routines and other elements available to the action as globally. This is how to use the ExecutionFile method:


         
'Action begins
     ExecuteFile "C:YourFunctionLibrary.vbs" 


4. Using LoadFunctionLibrary


LoadFunctionLibrary is a new method which was introduced in QTP 11, which would allow us to load a function library when the step runs. We can load multiple function libraries in a single line using a comma delimeter. This is how to use the LoadFunctionLibrary method:


     'Associate a single function library
    LoadFunctionLibrary "C:YourFunctionLibrary_1.vbs" 
    'Associate more than 1 function libraries
    LoadFunctionLibrary "C:FuncLib_1.vbs", "C:FuncLib_2.vbs" 

Saturday, June 28, 2014

Facing problem in UFT 11.5 with Find (Ctrl + F) and breakpoints ??

Are you facing problems to perform "Find (Ctrl + F)" operation and adding "Breakpoint" in UFT ??
Unified Functional Tester will not support these 2 operations for the .vbs and .qfl files. It is supported only to the Tests.

So how to perform these 2 operations in your library files ?

Here is the solution for it.

Associate the library function to the Test or Action. by doing this, we can perform Find and Breakpoint operations.

How to Associate file :
1. Open the library file, right click on the tab of the library file and click on "Associate Function Library With"


2. Go to File -> Settings
Select Resources in the Test Settings Dialog and add the Resources by clicking on the "+" button



Friday, December 9, 2011

Error starting JBoss server after QC (ALM) installation

Probable error message when you run the run.bat file
"Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
Press any key to continue . . ."
or
"There was an error starting JBoss server"
or
"Unable to start the JBoss server"

The Solution:
This error is because of heap memory allocation for the JBoss server. By default Application Life-cycle management (Quality Center) tool allocates memory based on the RAM size of your computer. Unfortunately Java 32-bit version supports only a maximum heap size of 1536MB only.

64-bit Windows

If you are using 64-bit windows, check if you have 64-bit Java installed. For resolving the issue, uninstall your 32-bit Java and install 64-bit Java.

If you do not wish to Uninstall/Reinstall, ie want to continue using the same Java, then follow the steps specified in 32-bit windows section below.


32-bit Windows
If you are using 32-bit windows, you need to decrease the heap size of JBoss server. How to do that?
1) Go to your ALM path (By default it will be "C:\Documents and Settings\All Users\Application Data\HP\ALM")
2) Open the folder named JBoss
3) Open the folder named bin
4) Locate a file named run.bat
5) 'Right-click' on the file and select 'edit'
6) Look out for a line similar to "set JAVA_OPTS=%JAVA_OPTS% -Xms1024m -Xmx1024m -XX:MaxPermSize=256M". It may not be the same exact line, depending on your RAM the ALM installation would have different values. The two 1024 may change and teh 256 may change, remaining would be the same.
7) After locating the line, change it so something like "set JAVA_OPTS=%JAVA_OPTS% -Xms512m -Xmx512m -XX:MaxPermSize=256M" so that the total size is not going above the 1536MB.
8) Save the file
9) Double click on "run.bat"

Within a couple of minutes, you should see JBossXXXXXX Started in XXXX ms


Related Posts:
How to download Quality Center?

How to extract Quality Center files?
How to install Application Lifecycle Management (ALM) platform?
How to configure the Application Lifecycle Management (ALM) platform?

Thursday, December 8, 2011

How to Install QC 11 (Quality Center) / Application Lifecycle management (ALM) 11? Part 2 – Extracting the files

This is second part of four-part series on How to Install QC 11 (Quality Center) / Application Lifecycle management (ALM) 11

Click on the first part if you landed on this page accidently/missed the first part on How to download QC 11 (Quality Center) / Application Lifecycle management (ALM)

1) Ensure that both the files are downloaded in the same folder, if not ensure you copy the files in the same folder.


Click on the image to enlarge
 2) Ensure the names are same except for the extension (Viz Software_HP_ALM_11.00_Windows_TC096_15000.zip & Software_HP_ALM_11.00_Windows_TC096_15000.z01)

3) Install winrar if you don’t have it already. You can download it here

4) Now, right click on the zip file we downloaded (viz Software_HP_ALM_11.00_Windows_TC096_15000.zip) and select the option Extract to Software_HP_ALM_11.00_Windows_TC096_15000

Click on the image to enlarge
5) It will create a new folder in the current directory as shown below.

Click on the image to enlarge
6) Wait for the extraction process to complete

7) Now open the newly created folder, it will contain a file named TC096-15000.iso, repeat the same step as above. Viz Rightclick on the.iso file and select Extract to TC096-15000

8) This will create a new folder in the current directory as shown below

Click on the image to enlarge
9) Wait for the extraction process to complete, comparatively it will take more time now.

10) After extracting open the newly created folder, it will contain the below folders

Click on the image to enlarge
We now have all the files we need for installing Quality center 11 aka Application Lifecycle Management 11.

This is the end of Part 2 - Extracting the software, please continue with How to Install QC 11 (Quality Center) / Application Lifecycle management (ALM) 11 – Part 3 Installing the ALM platform

Also Read,
ALM - QTP integration
A sample framework for ALM – QTP integration