In this post, I am listing some of the common problems and its solution which might occur in test automation using UFT. These Solutions are in the form of workaround, and solves the purpose almost completely. So here we go.

UFT crashes after seat license installation

With the release of UFT Service Pack 11.51, there was an issue that occurred when seat license is installed.  If you are getting your UFT crashed as soon as you start it after successful installation of the seat license, remove the Rainbow folder under below path in registry

on 64 bit :

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Hewlett-Packard\HP Service Test\

 

on 32 bit :

HKEY_LOCAL_MACHINE\SOFTWARE\Hewlett-Packard\HP Service Test\

 

Not able to add more than 10 Tests to the solution

If you are trying to add more than 10 tests or business components into a solution in UFT and you are getting the error as below

 

To add more than 10 items to the solution:
  1. Edit the <%appdata%>/local/uft/uftproperties.xml file.
  2. Modify maximum tests in solution property to the required number:<MaximumTestsInSolution value=”10” />

This may take a bit longer time to open the solution and impact memory consumption.

Object Spy Performance

If you are experiencing the decreased performance of object spy, like loading time, UFT gets hang frequently especially when dealing with object intensive pages or working with many add-ins loaded. This can be due to the enhanced object spy features, which when disabled can solve this issue.

Add the registry entry below to disable the advanced features of Object Spy.

HKEY_CURRENT_USER/Software/Mercury Interactive/QuickTest Professional/MicTest/DisableObjectsHighlight =dword:00000001

HKEY_CURRENT_USER/Software/Mercury Interactive/QuickTest Professional/MicTest/DisableSpyEnhancement=dword:00000001

 

Heavy Log files

In case your log file created by UFT becomes very large somehow, and you want to avoid this then there is one option to disable the default logging. Here is how to do this.
Go to the UFT installation folder
modify the config file <UFT Installation>\bin\UFT.exe.config, and change this section below at the bottom of the file to:

<root>
<level value="OFF" />
<!-- Here you can configure which log appenders should be used -->
<appender-ref ref="ColoredConsoleAppender" />
<appender-ref ref="Recorder" />
<appender-ref ref="FileAppender" />
</root>
</log4net>
</configuration>

 

Unspecified error when clicking an object in Windows 8

When working on a Windows 8 machine, using the .Click method on a Standard Windows object (such as WinButton or WinEdit) from an InstallShield Dialog window, UFT fails to run the step and generates an error: “Unspecified error”. This is because, In Windows 8, UFT cannot record over applications that have a higher integrity level, such as setup programs or programs that are run as administrator.

See also  The Power of Insight Object

In order to make this work, run UFT as administrator:

1. Right-click on the UFT icon or executable
2. Select the “Run as administrator” option

To use this option for all users:

1. Right-click on the UFT icon or executable
2. Select “Properties”
3. Click the Compatibility Tab
4. Check the Privilege Level checkbox “Run this program as an Administrator”
5. Click the “Change settings for all users”
6. Click Apply > OK

 

If you know a workaround for an issue with QTP or UFT, Please do share with all of us. You can do so by commenting at the section below.

23 COMMENTS

    • Hi Malini,
      One option would be to use “ShellExecute” Method.

      Code snippet would be in your vbs file as below (assuming you are writing your script in vbs to launch QTP/UFT)
      Set objShell = CreateObject("Shell.Application")
      objShell.ShellExecute "your QTP/UFT Exe Path", "", "", "runas", 1

      Here is more info about ShellExecute Method
      ShellExecute method is used to run a script or application in the Windows Shell.
      Syntax
      .ShellExecute "application", "parameters", "dir", "verb", window
      Key
      application The file to execute (required)
      parameters Arguments for the executable
      dir Working directory
      verb The operation to execute (runas/open/edit/print)
      window View mode application window (normal=1, hide=0)

      runas verb is undocumented and for elevated mode/admin mode the value should be 1

      Hope this is useful, let me know if you find any issue.

  1. hi Saket, I have any Issue, I want to open application using admin rights in qtp .how to open application as admin/

    • Hi Archana,
      try this
      SystemUtil.Run "CMD", "/k runas /profile /user:\administrator "
      Window( "object class:=ConsoleWindowClass" ).Type "" 'admin password
      Window( "object class:=ConsoleWindowClass" ).Type micReturn

  2. HI Saket

    I am facing an issue while running long Scripts (3-4 hrs) from HP ALM.

    The automator runner shows the status as passed but ALM does not update the status of the test case in test lab.The status is set to Not completed.

    Can you please help in this issue.

  3. Hi Saket,

    Thank you for these helpful work arrounds,
    Please I did not find in my machine the uftproperties.xml file or any file where I can modify the number of tests per solution, what should I do ?

    another problem: when running a test on UFT, many instances of EXcel and Iexplore are created, any advice please ?

    Many thanks

    • Hi rh,
      Sorry for late response on this.
      Uftproperties file must be there in appdata folder. Please make sure to check at the correct location.usually the location would be
      C:\users\appdata\local\hp\uft

      For your 2nd question: please check record and run settings..If you have set ie and excel to open when run begins. Check in web and windows application tab. Also make sure you don’t have any such statement in your debug window.

  4. Hi Saket,

    am working on OBIEE application through QTP. I have created script to navigate through multiple reports. Script throws an unspecified error while accessing report name. sometime it works correctly, sometime throws an error. I have set up Dcomcnfg setting and also running QTP as administrator, still getting an error. Please provide me solution ? Find below code :
    For PIndex = 2 To Ubound(segment)
    RRow = Browser(“Oracle Business Intelligence”).Page(“Oracle Business Intelligence”).WebTable(“Report List Table”).GetRowWithCellText(Trim(segment(PIndex)),1,1)
    Set RunReportLink = Browser(“Oracle Business Intelligence”).Page(“Oracle Business Intelligence”).WebTable(“Report List Table”).ChildItem(RRow,1,”Link”,0)
    RunReportLink.click

  5. Hi Saket,
    I am working on API(REST Services) automation using UFT, where my requirement is, i need to pass one parameter as QUERY parameter. i am not able to do that using UFT.I am passing the data to each parameter using excel data.if you know how to automate this using UFT API Automation then your quick response is appreciated.

    • Hi Kedar,
      it will be easy to help if you can elaborate a bit. what you have tried and if you are getting any error or where exactly you are facing challenge.

      Thanks,

  6. hi, i am trying to integrate jenkins and uft 14. i want to change the setting om error>display popup to on error>stop run. as the execution gets stuck if there is any error in one of the tests also. Any idea how to implement it for all tests without having to manually set it for all tests.

    • One approach which immidiately comes in my mind is to create a batch file to launch UFT and and run your test. as soon as you launch UFT you can change the settings. This way you will not have to change this settings in each of your tests.

      Dim App 'As Application
      Set App = CreateObject("QuickTest.Application")
      App.Launch
      App.Visible = True
      App.Test.Settings.Run.OnError = "NextStep"

      In Jenkins config you should Choose ” Execute Windows Batch Command” in Build Step

      Let me know if this helps

  7. Dear Saket, I have issue with identifying objects by UFT if I start desktop application with “Run as Different User”. The same scripts work fine with User with whom i logged in to desktop machine.

    do we have any solution for this?

    • Hi Santosh,
      Interesting and very strange. so far I have not came across such situation instead the other way around. we have done lots of automation with multiple roles by switching to different user without any issue. Could you let me know the behavior in this case, what do you get when you spy? or execute? any error message?
      you may want to log a ticket with Micro Focus.

  8. Hi Saket,
    I am trying to automate one of the application installation process. But the application asks for restart of the machine in between the installation. How can we achieve this using the UFT when machine restart is asked inbetween?

    • Hi Kishore,

      I have done this long time back. I did using vbscript only, I think its possible using UFT as well. You should create your script and trigger the flow based on different flag.

      You should use a flag kept somewhere as config or any file where it can be accessed after restart. Have a batch(.bat) file setup to execute as soon as window restarts. Your bat file should look into the config if the flag is ON (which you should set before restart) and continue with rest of the execution.

  9. Hi Saket,
    I just downloaded UFT 15.0(using trial version for now) and tried to record a script but my action doesn’t gets any statement even object spy is unable to grab object properties, just stuck at the beginning. Am I missed any setting/configuration?
    Your suggestions can help me out on this.
    Thanks and Regards
    Anil

    • Hi Anil,

      please provide more details about your application/technology. make sure you have right add-in enabled. also ensure UFT to launch first then your application.

  10. Hi Saket,

    Thank you so much for the reply.
    Actually I need to test a .NET application but my UFT trial version doesn’t have .NET add-in to select.
    But I tried with google.com with web add-in and it didn’t recorded any step for this also.
    I don’t know whether it is a add-in related issue or something else. Here I launched UFT first.

    Thanks and Regards
    Anil

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.