How to Record a Script in Chrome Browser in UFT

Before the introduction of UFT, QTP could only do recording on the Internet Explorer browser. However, QTP was able to playback the same recorded scripts on different browsers like Google Chrome, Mozilla Firefox, etc. Moreover UFT has further enhanced its features and become and a very powerful automation tool loaded with lots of features and capabilities.

Using UFT you can record and playback scripts on the following browsers.
  • Microsoft Internet Explorer (32 bit)
  • Microsoft Internet Explorer (64 bit)
  • Google Chrome
  • Mozilla Firefox
  • Apple Safari(on remote Mac Machine)
  • Chrome Emulator
  • Phantom JS

In this tutorial, I will show you how to use UFT Record and Run Settings to record a script on the UFT supported browsers. The following is the example to record a script on Chrom browser. However, you can follow the same steps to record and run the script on other browsers by selecting the required browser in UFT Record and Run Settings.

How to Record a script in Chrome Browser in UFT

To record or run a UFT script on a required browser go to Record>Record and Run Settings. The record and run settings window will be shown.
Record a script in Chrome Browser in UFT
From the browser list box selects the required browser on which you want to either record or playback your UFT automation scripts. Also, provide the URL of the required application and click on the OK button.
You will see the following floating bar on the top right corner of the UFT editor. You can click on the small square button to stop recording when you are done with recording a script.

Now if you start recording, UFT will automatically invoke the specified browser and open the provided URL. It will identify the objects in the same fashion as it does on Internet Explorer. You can also see the number of steps recorded on this floating bar.

You can record a script in one browser and run the same on another browser. For example, you can create or record a script on Internet Explorer and run the same on Mozilla Firefox and Google Chrome, etc.

How to Run a script on the desired browser Using Code

To run a test script on the required browser follow the below syntax.
SystemUtil.Run “Browser .exe file path” , “URL”

Here I have shown the example of opening the HPE demo mercury application on internet explorer and Google Chrome. These scripts run successfully on both browsers without any issue. In the same fashion, you can invoke any supported browser by UFT and run your automation scripts. You can write the rest of the automation script after invoking the desired URL on the required browser.

Note: You can use UFT Record and Run Settings if you are a novice on UFT and trying to learn UFT. Having said that, one should control the automation script flow rather than UFT record and run settings.

Recommended Posts

This Post Has 4 Comments

  1. Mike

    UFT do not records script when i use chrome browser even if the UFT agent Extension is activated.
    Do you have an idea to solve this issue ? Thanks

    1. Sarfaraz Alam

      Hi Mike

      I would suggest you to first open UFT and then open the application in the chrome browser and try to record the steps. UFT will start identifying the objects as well as record the steps. Hope it will resolve your issue.

  2. mike

    Hi Sarfaraz,
    Thank you for your response. I just re tested for recording per the steps. Unfortunately still no luck. Kind of Weird.

    1. Sarfaraz

      Hi Mike

      You can check out the following things.

      • Check your UFT version. UFT v14.50 only supports Chrome v67 and v68 and UFT 15.02 supports Chrome v83-v86. If you are using higher version of Chrome, please down grade it to the version supported by UFT.
      • Before start recording using check whether UFT is able to identify the objects using object spy.
      • Please make sure that the UFT Extension in Chrome is enabled and zoom is set 100% before you start recording in UFT.
      • If none of things work you can please ask your organization to create support case to Microfocus team.

Leave a Reply