Executing automated UFT\ALM tests from Jenkins

Get Trained and start executing UFT tests from Jenkins. Click Here for more details.

Hello Friends,

In this post, we will discuss integrating Jenkins CI tool with HP UFT.

Introduction

Jenkins is a CI tool which basically monitors external job executions and it’s mainly used by developers for building and deployment of code. It provides several functions like scheduling of tasks called jobs in several remote machines called as slaves in terms of Jenkins vocabulary. In this post, we are going to learn how to setup Jenkins from scratch for executing UFT automated test cases.

First, we need to understand, what is the need for running the automated tests with CI tools? It’s not just applicable for Jenkins, its applicable for any other CI tools or automation tools available in the market. Most of the people are going to tell you about agile and Smoke testing, those are correct and we will go back to this topic in other posts. First, we will look into more common issues which teams will face.

I was very happy with learning new languages and implementing new things for my project, and then one day we did some analysis and it seemed that we were spending most of our time in executing older regression test suites and we have only 20-30 % of our time left for development of new test cases, and it’s the problem which was growing day by day more severe.

So, the only solution for this problem is to assign the execution of the scripts to the actual owners. It seemed ideal, but in the real world that’s not as easy as we think, everybody has their own tasks to be completed, plus they didn’t have the knowledge for using UFT and you will be pushed back to ground zero, from where you started.

On the other side, tests we had were automated test cases, and hence by definition, they are supposed to be run automatically. But due to the manual interventions required due to the nature of scripts or application, it was close to impossible to execute the most of the scripts on a headless remote machine.

To resolve these issues we tried HP ALM’s Lab management tool, but I realized very soon that it can only execute the test cases so if you have to execute a bunch of scripts before or after execution of the scripts, you cannot. Also, there is no way to approve the results and a lot of time issues with the remote machine cause the test to fail.

There is another way of doing it using Automation Object model, but I really don’t want to take the headache of maintaining another piece of code which might change between versions of UFT.

I tried Jenkins and I am still using it, basically, it does everything, let’s see how…

Installation of Jenkins Server

If you don’t have Jenkins server, then follow this guide for the installation of the server. If you have installed Jenkins server using windows setup, you can access Jenkins server using the following URL

http://ServerName:8080

Check your Jenkins workspace path and update if required.

Create slave machine for the execution of the UFT scripts(Machine where UFT is installed), and install the following plug-ins

List of required plugins for the setup

  • Copy Artifact Plugin
  • Dashboard View Plugin
  • Discard Old Build Plugin
  • Email Extension Plugin
  • Extra Columns Plugin
  • Flexible Publish Plugin
  • HP Application Automation Tools Plugin
  • Test Result Analyzer Plugin
  • Time Stamper Plugin
  • Workspace Cleanup Plugin

Most of them are self-explanatory, but if you need any other details then, Google with the exact name of the plugin.

Creating Jenkins job

Once, you are able to open the Jenkins server, Click on “New Item”

Jenkins New Job

Provide any Item name, select “freestyle project” and click on “OK” button

Jenkins New Job Name

Once, you click on OK button, New Job configuration page will open. This is the main configuration page, where we will provide all of the configuration details about how the Job should execute.

Fill out the following information within the job configuration page

1) Description: Description about the job and the UFT test which is tied to this job.

2) Check on “Restrict where this project can be run” and provide the slave machine name with UFT installed. This is a very important step, because otherwise Jenkins will choose a slave machine randomly, and might choose Jenkins master machine (where Jenkins is installed) for execution. This will cause the job to fail.

3) Select appropriate build triggers, if you are using any source code control for storing UFT tests (Except ALM) e.g. GIT, SVN, TFS.

4) Under Build environment select “delete workspace before build starts”. This will help us in cleaning up the workspace and have a fresh start for each execution.

5) Click on Add build step button under build and select “Execute HP Tests from file system”. This will allow you to execute the tests from file system e.g. “C:\” or network drives.

Jenkins Execute HP tests From File System

6) Provide UFT tests or Solution path in the “Tests” text box. If you provide UFT’s solution file path then all tests under solution will be executed one after another. Leave Time out seconds blank.

7) Click on “Add post build action” under post build actions, and select “Publish HP test results”. Select “Always Archive HP test Reports”. This step will generate and archive Junit results for the execution on the Jenkins server, which can be used for analysis. we will discuss this in detail later.

8) If you have configured the email server then Add another post build step and “Editable email notification”. This option will send automated emails after the execution is over. We can attach any files in the email or we can send any files as the part of the email body.

After filling out the above information, Click on Save button and start the job by clicking on “Build now” button within job details page.

Jenkins Build Now

Once the execution is started, click on Build number, under build history, to check the current execution details

Jenkins Build Number

While the test is executing, you can click on Console output, to check the current execution status.

Jenkins Console Output

Once the execution is completed, you can see the test results on the Build page, under test results

Jenkins test output

This completes the basic configuration of the Jenkins Job.

How it works?

When you execute a UFT test from Jenkins, HP automation tools plugin will copy the following files to the Jenkins Job workspace directory

1) HpToolsLauncher.exe – This is the file used for actual execution of the UFT tests .when you take a closer look at the console output of the Jenkins build, you will see a line

"C:\Jenkins\workspace\JENKINS UFT TEST\HpToolsLauncher.exe" -paramfile props23032015132505096.txt

If you execute this line on the slave machine UFT test will execute.

2) LRAnalysisLauncher.exe – For load runner.

3) propsXXXXX.txt – This is the properties file for the HP Automation tools plugin. This will store different parameters required for the execution of UFT/Load tests.

4) ResultsXXXXX.xml – This is the JUnit results generated by the HpToolsLauncher.exe after the execution is completed. When we choose to create a post build step and choose to “Publish HP run results”. This Junit file will be uploaded back to the Jenkins and produce the test results shown in step 12 above.

General Issues faced during test execution

There are several issues you may encounter during the execution of UFT tests from Jenkins

1) If scripts have any “MsgBox” statement or any “InputBox” statement, scripts will directly fail.

2) If the machine is unlocked, then there is a chance for complex applications to fail.

3) We have to make sure that machine is cleaned up before and after the execution of tests(Closing all browsers and any other types of files like excel sheets or word documents).

4) We have to make sure that UFT scripts have a proper error handling mechanism or UFT will throw an error message and Jenkins Job will fail as soon as Popup appears on the page.

5) If we have a proper framework for our scripts, then most likely we will be executing multiple tests within one UFT test. Because Jenkins HP Automation tool can only count UFT tests and there is no way to indicate no. of tests, if you execute 2 UFT tests having 20 tests each, Jenkins dashboard will only display 2 tests executed, not 40 tests executed.

6) If UFT test report’s a failure in any of the tests, you will see the failure of Jenkins complete Job instead of a particular test case.

let’s see how to resolve each of these issues to create a perfect Jenkins job for executing automated UFT tests.

1) Replace any statement which requires human intervention

We must scan our scripts and replace any statements which require human intervention like MsgBox statements must be commented and should only be used during debugging. For any steps which use Input boxes for accepting inputs, use test parameters and action parameters. For receiving information back, use reporter.reportevent instead of msgbox statements.

2) Use Physical desktops, instead of virtual machines

If we use virtual machines as Jenkins slave machines, then we will have to make sure that the machines are up and running all the time, because virtual machine can go blank without any prior warning, if the user disconnects them.

3) Unlocking remote slave machine before executions

To overcome this issues, if possible change the machine setting, so that machine never locks automatically. But this option is not available in most of the companies because the machines running UFT will most probably have admin rights and it’s not advisable to leave the machine with admin rights unlocked.

First test your scripts, if they are able to run in the locked machine. If not then, you can use the following commands to unlock the Physical desktop machine from another computer (In case you are at home or other location).

For Unlocking the Remote Desktop(Physical machine)

Run on the command prompt

Query User

This command will provide the Session ID for your Login Session

JenkinsQueryUser

Once you have the session id of your session execute the following command

Tscon <Session id from previous commapn> /DEST:Console

This command will unlock the desktop machine and you can execute your test normally.

4) Include Machine Cleanup Framework in UFT

Machine cleanup framework is explained here. This framework will use the VBScript classes for executing predefined cleanup code. This is required because, if the previous execution of code leaves some things open then, your subsequent executions might fail.

5) Include proper error handling mechanism in your scripts

Recovery scenarios cannot handle errors properly, for running tests from Jenkins you will need a way to handle all kinds of error, including UFT’s general run error’s. Because, if UFT throws a general run error, then your Jenkins execution will fail, while UFT will be waiting for someone to click on the error and close the test manually and this will create issues with the subsequent test executions. A detailed description of how to implement this framework is explained here.

Executing tests in Parallel

For execution multiple tests in parallel, you can choose to do one of these two methods

1) Open the tests and update the Label expression under “Restrict where this project can be run”, with the slave machine name. Once you update the two different tests with different machine names, you can execute the tests in parallel on those two machines (provided you have the proper licenses for executions).

2) Now, the previous method works, but that’s not the best way to execute parallel tests within Jenkins. To implement the second method you will have to figure out the machines with similar properties like “UFT MACHINE WITH IE 8”, so this is a specific machine having UFT installed and can be used for the apps which are only compatible with IE 8. Once you have all the machine characteristics identified you can then open the slave configurations for the machine and update these names in the Slave labels. Once this Logical grouping of the Machines is done then you can provide this logical name with “Restrict where this project can be run”, instead of machine names. Using this method, you wont have to actually remember about the machine names and go through the whole hard process to identifying which machine you should execute the test.

JenkinsSalveConfig

JenkinsRestrictWhereProjectsCanRun

One more advantage of this method is if you have two machine with Label “UFT MACHINE WITH IE 8”, and when you execute the test, if the one of the machine is busy, then Jenkins will automatically Pickup the second machine and use it for execution.

Building test queue(sequential test execution)

Jenkins will automatically build the execution queue, once you select more number of jobs then the machines you have. These tests will be executed automatically when the machine will become free. To check this, Update the “Restrict where this project can be run” of three Jobs with the same slave name. Now, click on home page and Click on “Schedule a build” button for all three jobs, one after another and you will see the build queue, on the left side of the home page under “Build queue”.

Executing tests from ALM

For running tests from ALM, you have to make three changes to the current configuration explained above.

1) Add ALM Server

open Jenkins -> Manage Jenkins -> Configure System and find the sub section “Application Lifecycle Management”.

Click on “Add ALM Server” button. Provide the server name as Test or Prod or Dev and enter the server URL till qcbin. Click on save and apply.

You can add multiple ALM Servers.

2) Use “Execute HP Functional test from HP ALM” instead of “Execute HP tests from file system”.

Add the Build Step “Execute HP Functional test from file system”. Select ALM Server name from the “ALM Server” combobox. Provide Username, password, Domain, project and Test Set Path for the execution of the tests. Test set path is the actual physical path which you see in the ALM test lab tree structure starting with Root\

JenkinsExecuteTestFromALMServer

3) Check the advanced setting,

if you want to execute the tests on specific host defined in ALM.

You will see the following changes in the execution process

Modified Console Output

When you execute your tests from ALM Server, you will see one change in the Console output, you will start seeing all of the Reporter.reportevent statements on the Jenkins console log.

This feature can be used to check the current progress of the execution.

Automatic Execution update in ALM

Test execution status will be uploaded automatically to ALM Server.

Additional helpful setting\upgrades

1) Instead of using “Publish HP Run results option”, Create and upload your our own Junit results

When, one UFT test executes 100 test cases, HP Automation tools plugin will only return either one pass or one fail. To over come this create your own Junit results xml file at runtime after the UFT execution is completed. This will also serve as a checkpoint, if the UFT execution is completed successfully then only we should have a JUnit file generated.

Once you have this functionality implemented, you will start seeing awsome results on Jenkins and you will unlock the real power of Jenkins. JUnit results XML will look like this

<testsuites>
<testsuite Name=“FirstAutomation” test=“2” failures=“0” time=““>
<testcase name=“test1” classname=“FirstAutomation.TestCases” time=“27.68359” status=“pass”>
<testcase name=“test2” classname=“FirstAutomation.TestCases” time=“13.33203” status=“pass”>
</testsuite>
</testsuites>
When you publish this file after one UFT test execution you will see two passed test instead of one passed tests.
JenkinsJunitUploadedResults
In this above example, i have executed several tests and 17 of them failed. All of the tests were under one UFT test
To publish the JUnit results, add the post build step “Publish Junit test result report”. Provide the JUnit file path and enter 1.0 in the Health report amplification factor.

2) Upload test Artifacts to Jenkins

Jenkins will allow to upload the artifacts back to the Jenkins server. We have to use the copy artifacts plugin to do this. Within UFT you can create a function and call it within the Machine cleanup Framework’s class initialization(to make sure it executes) to setup the export of UFT datatable and UFT run results to the Jenkins workspace like this

Public Function SetQTPParameters()
Dim App 'As Application
Set App = CreateObject(“QuickTest.Application”)
App.Options.Run.AutoExportReportConfig.AutoExportResults = True
App.Options.Run.AutoExportReportConfig.StepDetailsReport = True
App.Options.Run.AutoExportReportConfig.DataTableReport = True
App.Options.Run.AutoExportReportConfig.LogTrackingReport = False
App.Options.Run.AutoExportReportConfig.ScreenRecorderReport = False
App.Options.Run.AutoExportReportConfig.SystemMonitorReport = False
App.Options.Run.AutoExportReportConfig.ExportLocation = JenkinsWorkSpacePath
App.Options.Run.AutoExportReportConfig.UserDefinedXSL = ““
App.Options.Run.AutoExportReportConfig.StepDetailsReportType = “HTML”
App.Options.Run.AutoExportReportConfig.StepDetailsReportFormat = “Detailed”
App.Options.Run.AutoExportReportConfig.ExportForFailedRunsOnly = False
End Function

After creating this function, on the Jenkins configuration, add a build step “Archive the artifacts”.  This is Upload the results back to the Jenkins server and will be visible for each execution. The default Archival path is Jenkins workspace, but we can also point it to the child folder inside jenkins workspace.

e.g. If Jenkins workspace path is “C:\Jenkins”(Create this in Slave Config -> Remote Root Directory) then the Job execution path will be “C:\Jenkins\JENKINS UFT TEST\”

to archive the artifacts from the child folder within workspace e.g. “C:\Jenkins\JENKINS UFT TEST\ExecutionResults”

use “ExecutionResults/*” in the files to archive textbox

In addition Upload any artifacts related to the test execution to Jenkins, if required.

3) Use Dashboard Plugin to create execution dashboards

Once, you have dashboard plugin installed in the Jenkins, create dashboard views and add test execution statistics Grid to it. This will pull the data from the Jobs latest JUnit files and publish the data on the Dashboard page Providing summary on the Dashboard home page.

JenkinsResultsDashboard

Above is the snippet of the Test execution statistics Grid.

4) Use Flexible publish to produce the results

Use the flexible publish plugin to figure out things like, if the files are generated before actually passing the Jenkins job or failing the Jenkins Job. One example is check if the Junit results are generate before archiving them to Jenkins server. If the file is absent then Jenkins will throws an error and fail the job.

5) Close and open HP Remote agent during each run session

I have included a separate batch file for running the remote agent launcher during each run session and close it after the execution is over. This will make sure that all of the UFT related processes and connection are re-established during each run session.

6) Use “test result analyzer” for result analysis

You can use the test result analyzer for analyzing the results of two separate executions. To Open, Click on “Test Result Analyzer” on the job description page.

Test Results Analyzer

If, we have 100’s of tests, it might not be very easy to analyze the results between two executions, but if you have Custom JUnit reports generated, then you can use this feature for analyzing the results between any two executions

7) Use Batch File to Kill UFT

Create a batch file to kill UFT and add this to build step after the step for the execution of the UFT Test. This will make sure that UFT is not hanged in between and also if the Jenkins Job is stopped due to some reason you will have the machine ready for the next one.

Let me know, if you have any questions and i will try to resolve them.

Thanks

276 responses to “Executing automated UFT\ALM tests from Jenkins

  1. Hi,
    We have a physical server acting as a slave that runs our UFT scripts via ALM. The issue is that is it not headless. Someone has to physically log into the server and stay logged in to keep it active in order for the scripts to execute. If someone does not physically log into the server, the scripts will fail automatically. If they log into the server but step away for more than 15 mins, the machine will lock and the scripts will fail. We don’t want to have someone to have to physically log into the server and keep the server active everytime the scripts are kicked off. Is there a solution to this issue?

    Liked by 1 person

    • Hi Steve,

      There are several options to resolve this issue,

      1) Select the following UFT option

      Go to Tools->Options->General->Run Sesssions
      Click on the third checkbox “Allow UFT to continue running GUI or BPT after disconnecting from an RDP computer”, provide the credentials and check the connection.

      2) If you are running the scripts from ALM and using the Lab management, then during the installation choose the option to Unlock the machine if Locked, before starting the execution(I don’t remember it exactly) and provide the credentials for Unlocking the machine there.
      For using this option you need to be admin on the machine.

      3) If above things does not work then you can write a simple VBS utility and leave it running on the machine, which will prevent the machine from locking.

      4) If you are admin on the machine then you can change the system properties to never lock the machine.

      Let me know, if this helps or if you need any other help.

      Thanks,
      Sumeet Singh Kushwah

      Like

  2. Hi,
    I’m interested on the step regarding creating and uploading Junit results xml files. Is that done from the Jenkins side of things, or UFT? Is there a reference you could point me to on how that is done? If it makes a difference, I currently have Jenkins run ALM tests. Thanks!

    Liked by 1 person

    • Hi Tyler,

      It makes huge difference if you don’t have one to one mapping for the tests. My framework executes 20 or 30 manual tests, within one automated test. Now,when I execute this from ALM, ALM reports back that one test case is passed, because its only one UFT test which is passed.

      I have implemented JUnit results because, i wanted to check how many tests are executed passed/failed for a particular release. This tracking was done before using the excel sheets to figure out one UFT test corresponds to how many Manual ALM test.

      For Implementation

      We have to create the JUnit results at the end if the execution in UFT, Function looks something like this

      Juint results in UFT

      Link to Image

      Within Jenkins, I have the Post Build Step for flexible publishing of the results using “Flexible Publish Plugin”, where I am checking for the Junitresults.XML file and if the file exists, then i am using Archive the artifacts post build step for publishing the JUnit results.

      Also, we will have to change the build status from fail to Warning, because if the results are fail than dashboard will not pickup the results.

      Complete Implementation will look like this

      Jenkins JUnit Configuration

      Link to Image : Jenkins JUnit Configuration

      Let me know, if you need any other details.

      Thanks,
      Sumeet Singh Kushwah

      Like

      • Sumeet,
        IS my understanding right that, the UFT have to generate the Junit result file (.xml)? I am not from the QA background and the UFT, so execuse the nature of the question.
        I am creating this job to hook up UFT with jenkins and would like to publish the test result just like it does in the junit.

        thanks

        Like

      • Hi

        UFT generates the run results automatically. You can use the option to publish ho run results in post build actions on Jenkins. But if you don’t like that report then you can write a simple function to generate the junit xml at the end of Uft executions and then you can use publish junit results on Jenkins to publish the desiredresults.

        The problem I had was, my one UFT test is executing 10 different tests and if we choose to publish the inbuilt UFT results then you will see one pass on Jenkins.

        Like

  3. Hi there,
    What if I want to launch 1 single test from a specific testSet ? Is i it possible or do we have to stick with the testSet concept ?

    Thanks

    Sheeran

    Liked by 1 person

  4. Hello,

    I created a job with “Execute HP Tests from file system”. However, I have an issue. QTP runs in fast mode and so the scripts are failed. Can I configure somewhere in Jenkins QTP to run in slow mode? Please bear in mind that despite the fact that I have select slow mode in QTP, Jenkins always change slow to fast mode.

    Thank you

    Liked by 1 person

    • Hi Petros,

      You Can’t Change the execution mode to Normal, Because that’s changed by the Jenkins Plugin before triggering the tests.

      I tried setting this in the remote agent setting and within the scripts, but that’s not working because jenkin’s plugin is setting just before executing the scripts.

      But you can try the following things

      1) Increase the browser navigation timeout seconds and the Object synchronization timeout seconds.

      2) Include Exist(), Sync and Waitproperty functions within your scripts for make sure that the object exists before performing any actions.

      Let me know, if you need any other help.

      Thanks,
      Sumeet Singh Kushwah

      Like

  5. Hello Sumeet,

    In “Upload test Artifacts to Jenkins” section, you discuss about how to store results. Still I am bit confused with this. Can you please clarify me where this script to be placed(some where i Jenkins Configuration or in last step of UFT test cases). how are we going to get the result file into Jenkins?.

    What Iam trying is ” I am executing UFT test cases which are placed in ALM from Jenkins using ‘Execute HP functional test from HP ALM’, After execution, I want to store below details in DB.

    Total number of test cases executed,
    How many passed and how many failed.
    If possible, each test cases name and its status.”

    Can you please help me on this activity.

    Thanks,
    Suresh

    Liked by 1 person

    • Hi Suresh,

      You have to place the scripts in the first line of the UFT code, what it does is that, it will set the UFT option for exporting the datatable and the execution results report to the jenkins workspace folder. same can be achieved using the following UFT options

      UFT Test Options

      Configure automatic export

      Once this option is set, UFT will export the HTML results and the Data table to the jenkins workspace at the end of the executions.

      Now to upload the files on the jenkins you can add the post build step “Archive the artifacts” this will upload the datatable and the UFT results to the jenkins.

      Now this will only store the results generated by the UFT, if you want to create a Jenkins dashboard and provide the details there then, you will have to generate the Custom Junit results and copy them to the jenkins workspace folder at the end of the executions.

      Once you have the Junit results with the details about how many passed and how many failed, you can add the post build step “Publish Junit test result report”, this will upload the custom test result report to jenkins.

      Let me know, if you still have questions.

      Thanks,
      Sumeet Singh Kushwah

      Like

  6. Hi Sumeet,

    Can you please let me know how to get the ALM ‘Release name’ in the Console Output.

    I will be executing more no of test cases for different release. So getting the release name from the console would give more meaning for comparison

    Like

    • Hi Sridev,

      There are two ways to do it,

      1) If you are going to execute all of the tests for one particular release then you can use the build-name-setter plugin and change the Jenkins build name to the release name and after execution you can simply check the build name to identify that a particular execution is for what release. This is a time consuming process, but its the only way for non ALM users and some ALM users.

      2) You can use the QCUTIL object for getting the release name within the executing UFT scripts and then use the reporter.reportevent for sending it to the results. Once the execution is over you will be able to see the release name in the output.

      Let me know, if you need anything.

      Thanks,
      Sumeet Singh Kushwah

      Like

  7. Hello Sumeet, First of all, very knowleadgable article and thanks for putting this information together and making it public. Coming to my question, currently we have our build acceptance tests (BAT) and environment checkout scripts created in Selenium (Web driver) and they are configured to be kicked off from Jenkins (after each build). The scripts are executed on VMs in an unmanaged mode. We would like to achieve the same capabilities with UFT. I have read it in your article where you suggest to use physical desktops and I have had the same experience in the past where we had a test lab to execute our tests. But in my current organization, pretty much everything runs on VMs and our Leadership would like to keep it that way (unless we present a strong case). So we tried the do the launch RDP from Jenkins (using mstsc) but we werent successful. Do you have any other ideas and as well do you think it’s a viable solution?

    Like

    • Hi Murali,

      Thanks.

      We had the same issues with the scripts before; here are the few things you can try
      1) First thing to be checked is, if UFT can run your scripts in a locked VM, this is actually possible for some kind of apps like simple websites. If that works then you should be good. Before checking this option, open UFT in the VM and click on Tools->Options. Click on General Tab and then click on Run Session on the left side. Check the option “Allow UFT to run GUI ..” and provide the user name and password for the machine. Now try running the script on a closed VM(but logged in). If this doesn’t work then follow the next steps.
      2) In one of my previous projects, you actually have to allocate budget for creating and maintaining VM’s and this money will go to the team who is actually maintaining the VM’s, so the case we presented is that its actually costly to maintain a VM then maintaining the physical desktops. You can get a good physical desktop for $400, easily these days. So check if that’s something is done in your organization also.
      3) If you cannot present the above case then, the solution will pretty much depend on the type of security implemented in your company. Try the following steps
      a. Configure the automatic login to the windows machines for the particular ID. This will make sure that as soon as you fire the MSTSC command machine will be connected without the need of someone providing the user id and password (I have not tried this but it should work).
      b. Once you have this setup, you can fire the below command to connect to the remote machine, in full mode.
      mstsc [] [/v:] [/admin] [/f[ullscreen]] [/w:] [/h:] [/public] | [/span] [/edit “connection file”] [/migrate] [/?]
      c. On the startup of the remote machine you can configure the scripts to start the Jenkins slave.
      d. Once the Jenkins slave starts you can trigger the scripts on the machine.
      e. In the end you can disconnect the machine using the shutdown command.

      Some of the above steps like configuring the auto login might be restricted because of the security issues which it will create. This might not be the ideal solution because, again you will only be able to execute one script in one physical machine which opens the VM, but you can use the same physical machine to open different VM’s you can use it to run different kind of apps.
      4) If you cannot do the above then, you can try, leaving the VM open on the secondary monitor of your desktop. Create an additional script which will not allow the VM to lock. How I maintained it, that people have taken ownership of the VM’s during offshore and onsite timings and they will try to keep the VM open. This solution comes with its own issues, but if you face any issues let me know and we will try to resolve them.
      5) I also wanted to understand the issues faced in Using the RDP connection, I will try to replicate and resolve the issue.

      Thanks,
      Sumeet Singh Kushwah

      Like

      • Hi Sumeet,

        I am trying to Execute HP tests from ALM and/or from File System from a Jenkins job. But I am getting the below error not sure what is causing the error.

        Started by user CVB, NMQ
        Building remotely on ABC-SIT-Slave (ABC-regression) in workspace c:\jenkins\workspace\ABC-Trunk-SIT-Automation
        Build step ‘Execute HP tests from file system’ changed build result to FAILURE
        Build step ‘Execute HP tests from file system’ marked build as failure
        Sending e-mails to: abc@xyz.com
        Finished: FAILURE

        I have HpToolsLauncher.exe in my jenkins workspace

        Like

      • Hi Sumeet,

        For Build Steps : Execute HP Tests either Locally or from ALM my job is failing. Below is the console input. The slave machine has UFT installed in it and I have the HpToolsLauncher.exe in the jenkins workspace.

        Other build step like Execute Windows batch command works fine where a vbs file is executed from the jenkins workspace which inturn opens UFT and a test script to execute in the slave machine.

        Started by user FGH, JKL
        Building remotely on ABC-SIT-Slave (ABC-regression) in workspace c:\jenkins\workspace\ABC-Trunk-SIT-Automation
        Build step ‘Execute HP tests from file system’ changed build result to FAILURE
        Build step ‘Execute HP tests from file system’ marked build as failure
        Sending e-mails to: cscscs.bcbcbc@gmail.com
        Finished: FAILURE

        Like

      • Hi Chandra

        You will see a line in your console output like this

        C:\Jenkins\workspace\\HpToolsLauncher.exe -paramfile .txt

        Can you copy that command and execute it in the Command prompt of the slave machine, where you want to execute the scripts and let me know, what is the output of it.

        If everything is correct it should start the executions.

        Otherwise send me the output and i will check it once

        Like

      • Summet,

        Somehow I am not able to attach or paste the screenshot. I can describe what I have on the Job:

        1) Restrict where this project can be run is selected and a label is selected as part of the Slave machine which is up and running. This slave has UFT installed and working properly..
        2) Source Code Management is None
        3) Build Triggers – Nothing is selected
        4) Build Environment – Nothing is checked – I could not find the option – Delete/Cleanup workspace
        5) Build – Execute HP tests from file system
        Tests – complete path of the UFT script
        I tried placing the script in the Jenkins workspace
        6) Post Build Actions – E-mail Notification

        Apply, Save and then Build Now.

        Like

      • Hi Sumeet,

        C:\Jenkins\workspace\\HpToolsLauncher.exe -paramfile .txt

        invoked the UFT test and ran successfully from the command prompt.

        Now when i run the jenkins job it is failing.

        Chandra

        Like

      • Hi Summet,

        My Jenkins job when build as Execute HP Tests is failing, not sure if I have missed anything. When the build is Execute Windows Batch Command it is working fine (I am executing a vbs file which opens UFT and executes the same).

        Regards,
        Chandra

        Like

      • Hi Sumeet,

        1) I am saving my scripts in ALM and placed in TestLab and I want to trigger those scripts from Jenkins

        2) The slave machine is made online by running the below command
        java -jar slave.jar -jnlpUrl http:///computer//slave-agent.jnlp -secret c39d7e593feddebsdsdsds8e8b2ee775ddecbf54c64a1d33bc763dee3e6cf3b516cfba08018

        Like

  8. Need some clarification regarding Executing tests in Parallel. I’m not seeing parallel execution option while creating new jenkins job. Please advise

    Liked by 1 person

    • For executing same job across multiple machine, you have to go to the node configuration of each machine and change the label. Make sure you are giving the same label to all of the machines where you want to run the job. So let’s say you give label to UFT_Machine. Next thing you will have to do is, go to the job and select checkbox “restrict where this project can be run” and in the label expression provide the label from the node configuration “uft_machine”. Now when you run the job twice it will be randomly assign it to the machines with label “uft_machine”.

      Let me know if you have any questions.

      Thanks
      Sumeet singh kushwah

      Like

    • Thank you very much Sumeet. Can you explain the difference between windows/ ALM Scheduler and Jenkins job scheduling. Please provide your input on this. It would help me to proceed further with Jenkins Integration in our project.

      Thanks,
      Suresh

      Liked by 1 person

      • Hi Suresh,

        1) Windows Scheduler is available under “All programs->Accessories->System tools->Task scheduler”. This can be used for scheduling the tests on a machine by executing the VBS file with the instruction which tests to be executed at what time.

        2) ALM Scheduler: This is the inbuilt functionality available withing ALM, where you can schedule the TEST runs for the automated tests stored in ALM. You will have to specify the Host names in the ALM, and you will have to install the ALM Lab service in the machine where you want to execute the tests. Once the lab service is connected to ALM, you can schedule and execute the tests on the machine with Lab service.

        3) Jenkins is the tool used for scheduling and executing the jobs, so by using the ALM plugin, you can execute the jobs as defined in the article.

        I will not advice using the task scheduler, because it will be very tough to maintain different machines with different task schedulers. and its not a one click process.

        You can definitely choose between running the tests using ALM test scheduler or jenkins.

        It totally depends on the environment you are in, and what you want to do, like for example i wanted to execute some of the commands and selenium tests with UFT tests, then jenkins is the way. you can’t do that with ALM scheduler, atleast its not easy. Also, ALM scheduler seems to be difficult to maintain then Jenkins, but its my personal opinion and you should try both of them and identify which one works best for you.

        Let me know, if you need any other details.

        Thanks.

        Like

      • Thank you very much for Quick Answer. Have few more queries
        1. We have multiple test sets in QC Test lab under specific Release folder but we want to execute 5 Test sets(each test set contains different test cases) using Jenkins.
        Could you please assist me how to execute selected test sets using Jenkins integration with UFT. Is it possible to execute selected Test sets in one project(For Ex: Project Name: “UFT_Release_08082015, “freestyle project”) or I want to create 5 different free style project with different execution time. Please provide your input on this. It would be much appreciated
        2. How about QC & UFT license consumption during script execution thru Continuous Integration(Jenkins) tool.

        Like

      • Hi,
        As far as I know this works,
        1) If you provide the test set path in the Jenkins, it will execute all of the tests within the test set.
        2) If you provide the Folder path containing the test sets, then it will execute all of the test sets inside it.
        3) You can provide multiple test set paths within one job, by separating it by new line and Jenkins will execute them in the order they are defined.

        Now to answer your question
        1) If you have those five test sets in one folder, then just provide the folder path in the Jenkins. If you have then in different folder, then provide new line separated paths to all of the folders.
        2) No you cannot provide the release name for executing the tests.
        One Full UFT license per machine will be consumed during the execution.

        Like

      • Hi Sumeet,

        Can we able to run failed test cases in specified Test set since it contains 50 test scripts in each test set. Around 30 scripts are passed and remaining are failed. In that case if i do the scheduling, again it would execute all the test scripts instead of Failed scripts? Is there any method available to run failed Test Cases alone in the particular Test Set?

        How About QC license consumption if i schedule it thru Jenkins?

        Please Clarify.

        Like

  9. Hi Summet,

    I am trying to trigger UFT scripts using ‘HP Application Automation tools’ plugin for Jenkins. I am getting the following error while building
    “Could not create scheduler, please verify ALM client installation on run machine by downloading and in installing the add-in form: http://homqcprd1/qcbin/TDConnectivity_index.html“. Could you please throw some light on this issue? Really appreciate for taking your time on getting this issue resolved

    Liked by 1 person

    • Hi,

      I am assuming, you have tried running the tests from ALM not from file system.

      Solution :
      I have received the same error, while running the tests from ALM for the first time.

      Go to the below URL

      http://homqcprd1/qcbin/start_a.jsp?Common=true

      for reinstalling the ALM files.

      What you have to do next is Go to the ALM URL till QCBIN

      http://homqcprd1/qcbin

      Click on Tools and download and installl ALM connectivity tool. Once you complete these two tasks, Open UFT and connect it to ALM once. And check if “Allow other HP products to run tests and components” is checked.

      Once everything is done, you should be able to execute the ALM tests from UFT.

      Reason for the error :

      You need to install the ALM connectivity files for running UFT tests stored in ALM.

      Let me know, if this resolves your issues or if you face any other issues

      Like

  10. Hello Sumeet,

    first of all thank you for your detailed article.
    I have a problem with the HP Application Automation Tools plugin and I hope you can give me some advice:
    I use HP UFT for GUI and API testing. I’ve created a .mtb file with the Test Batch Runner from HP which executes all the tests automatically in sequence. If I run the script in the Test Batch Runner they pass successfully.
    In Jenkins I’ve created a Freestyle Project and specified the path to the .mtb file in the “tests” text box. If I run the build only the GUI tests pass successfully and this error appears for the API tests:

    Running: ‘Path to the test’
    Test is executing
    Test is completed
    Error: A runtime license can not be found
    Test result: Error

    Do you have any idea how I can solve the problem?

    Thanks in advance

    Like

    • Hi Lia,

      when you execute the API and GUI tests together in one MTB file, do you select the UFT button on the toolbar after opening the test batch runner ?

      I found the following note in the help documents of test batch runner for UFT button on toolbar
      “Use HP Unified Functional Testing license. Instructs Test Batch Runner to use a Unified Functional Testing license during a batch run. Use this button only if your batch contains both Service Test/UFT API tests and QuickTest/UFT GUI tests.”

      There is no way to pass this parameter in jenkins now, and i guess that’s the reason for your test case failure.

      Resolution :

      1) you can try creating your oun .MTBX extension file, as explained below

      https://wiki.jenkins-ci.org/display/JENKINS/HP+Application+Automation+Tools

      “For functional tests (UFT), you can also indicate a batch file that contains a list of tests, along with their parameters. You can specify multiple tests, or the same test several times with different parameters. Note that you can use Jenkins environment variables in the path names. The batch file should have an .mtbx extension and follow this sample syntax.

      <Mtbx>
      
      	<Test name="test1" path="c:\tests\APITest1">
       	<Parameter name="A" value="abc" type="string"/>
         	 ….
        	</Test>
        	<Test name="test2" path="${WORKSPACE}\test2">
          	<Parameter name="p1" value="123" type="int"/>
          	<Parameter name="p4" value="123.4" type="float"/>
         	….
        	</Test>
      </Mtbx>
      

      2) create the sequence of tests in the jenkins job and separate each test with newline.

      I have not tried any of the solutions, because i dont use MTB files for executions.

      let me know, if this works, I will also try to implement these solution and let you know the results.

      Like

  11. Hi Lia,

    I was able to run the test successfully via the plugin ( using the UFT Solution test path directly), but was getting the same error that mentioned when I tried creating the .mtbx file and using that. I realized that the user on which my jenkins slave was setup as a service, was a different account ( system), and not my corp account under which UFT is licensed. I changed the service logon user and that resolved the issue. Good luck.

    -Allen

    Liked by 1 person

  12. Hi Sumeet,

    Can we able to run failed test cases in specified Test set since it contains 50 test scripts in each test set. Around 30 scripts are passed and remaining are failed. In that case if i do the scheduling, again it would execute all the test scripts instead of Failed scripts? Is there any method available to run failed Test Cases alone in the particular Test Set?

    How About QC license consumption if i schedule it thru Jenkins?

    Please Clarify.

    Like

    • Hi Suresh,
      I don’t think there is a way to configure Jenkins to execute the failed test from the test set.

      I can think of two scenarios

      1) Provide the individual test path in Jenkins for the 20 failed tests. Obviously that’s some additional work.

      2) write the piece of code to get the last run results for the current executing tests in UFT scripts and once you have that you can put the IF condition within the script to skip the execution, if the script is passed already. And you can also control if you want to have this condition enabled from the environment variables. The only issue is that passed scripts will be shown pass again. But you will save the time.

      One full QC\ALM License will be used during executions.

      Like

      • Thanks for your input Sumeet.

        How to schedule the QTP scripts in multiple slave machines(Remote machine) when we configure the build as “Execute HP functional tests from HP ALM” since jenkins server is kick started in VM.
        Exactly where we have to give multiple machine details in Configuration screen. it would be really helpful for us in triggering job in multiple machine. Please assist me. Thanks in Advance.

        Liked by 1 person

  13. Hi Sumeet
    Thank you so much for your valuable posts. They are very helpful.
    I have a question around setting the job to execute UFT tests from Jenkins.
    We currently have a shared Jenkins setup, which is administered by the Devs and Architects, I managed to get them to install the HP ALM plugin for Jenkins which they have done successfully.
    I managed to setup a job which runs remotely on my PC on the ALM server\connection part of the job. Do I also need to configure the “Restrict where this project can be run” to my PC? my machine is not currently configured as a Build Slave on the Jenkins server. My impression was that as long as the setting for ‘Run Remotely’ was set to my machine the scripts would automatically kick off.

    Like

  14. Hi Sumeet,

    Thanks for sharing the wounderful info, I am new to Jenkins while searching for end to end configuration got your post, really good info.

    I have few qns pls comment:
    1 )I had placed the UFT script by using HP file system but I had provided the path of the script which needs to execute but we have not defined to launch the QTP right so will test fail?

    2) My script are located in VM, how can I pass credentials so that it wont cause issue to Jenkins.

    3) is there a way to deploy the build in one machine and get the deployment status and trigger the automation run from Jenkins?
    Or if deploying the build is possible who can I do it.

    Please let me know.

    Liked by 1 person

    • Hi Prasad,

      1) When you run the jenkins job with build step to execute the tests from file system, and provide the path for the UFT tests, jenkins will automatically launch UFT and execute the scripts on one of the slaves. IF you want to execute the scripts on a particular slave than, you can use the option “Restrict where this project can be run” option. This particular slave must have UFT installed.

      2) You must keep VM open when you trigger the jobs. You can’t pass the credentials for the VM from jenkins.

      3) Again, you can select the option, “restrict where this project can be run” and provide the machine name for the slave where you have UFT installed. This will trigger the jobs in the particular machine. To get the results back to Jenkins, you will have to add the post build step as mentioned in the article (Publish HP Rum results). This will get the results back to the Jenkins job dashboard.

      Let me know, if you need any other details.

      Like

  15. Hi,

    Thanks for your blog.
    We are getting the following error. Can you please help us in identify the issue.
    ———–
    Building remotely on jenkinsslave in workspace C:\jenkins\workspace\workspace\UFT_Job_new
    [WS-CLEANUP] Deleting project workspace…
    [WS-CLEANUP] Done
    Build step ‘Execute HP tests from file system’ changed build result to FAILURE
    Build step ‘Execute HP tests from file system’ marked build as failure
    Started calculate disk usage of build
    Finished Calculation of disk usage of build in 0 seconds
    Started calculate disk usage of workspace
    Finished Calculation of disk usage of workspace in 0 seconds
    Finished: FAILURE

    Liked by 1 person

  16. Hi I am trying to execute ALM script through Jenkins.
    I have few doubts,
    * One ALM “TestSet” has multiple scripts, can we run individual test through Jenkins?
    *My requirement is I have one test set in ALM which has 20 test cases, I need to execute all 20 test cases using Jenkins parallel execution mechanism, how to achieve this?
    * what are the advantages of running jobs from Jenkins over Running directly from ALM?

    Liked by 1 person

    • Hi Manjunath,

      As far as I know, you can’t execute the single test, from a test set using the HP tools automation plugin. This can only be done if you are executing the tests from file system.

      If you have to execute parallel test then, please check the section “Executing tests in Parallel” above in the article and let me know, if you have any questions.

      There are several advantages of using jenkins like you can run tests in parallel and you can create the execution queue for overnight executions. Jenkins dashboard will make things much easier for you, if multiple people are executing the tests.

      It can also generate the reports and, using jenkins, you can integrate your tests to the development cycle.

      let me know, if you have any other questions.

      Like

      • Hi Sumeet,
        Thanks for the details.
        Yeah I have understood “RUN JOBs In PARALLEL” section but, my requirement is
        1 ALM test set has 30 test cases -> To execute complete test set it will take 4 hours.
        In Jenkins I can create 1 job for 1 test set name since for individual test case I cant create job.
        if It is possible to split the testcases of 1 ALM test set among the multiple slaves will save 2,3 hours of time so.

        Please suggest.

        Liked by 1 person

      • Hi Manjunath,

        if you can create tests sets with 1 UFT test in ALM, then you can execute different test sets in different machines using Jenkins. This will meet your requirement.

        Its not possible to split tests from one test set using Jenkins, you will have to do it manually in ALM.

        let me know, if you have any questions.

        Like

  17. Hi Sumeet.

    The post is very helpful.

    I am able to connect UFT with Jenkins. I have similar issue wherein I have one driver script running many test cases and all test cases are mention in a drive datasheet which is picked one by one but Jenkins provide me report of 1 test case passed or failed.

    I read what you mention about Junit results. I dont have much idea about Junit. Could you please let me know how to write a Junit for getting separate result.

    Thanks in advance.

    Liked by 1 person

    • Hi Lovesh,

      JUnit results is a simple XML file, with the predefined structure. For generating the JUnit XML, you can simple create a function which will add the results to this XML file, at the end of the executions. I have discussed the structure of the file in the “section 1” of “Additional helpful setting\upgrades”.

      Once you have the JUnit xml file, you can simply import, it in the jenkins in the post build actions(Publish JUnit test result report).

      Once you have the results imported, you can view the results under test results link withing the build.

      Let me know, if you have any questions.

      Like

      • Hi Sumeet.

        Thanks for your reply.

        Actually I am not getting where to write the Junit function in my driver script and how to get separate result.

        Can you please provide me a function which i can include in my UFT driver script so that it adds the result in JUnit xml

        My driver script looks like :-

        Call fn_Initialise_ADODB_objects ‘Initialise ADODB objects
        ‘ sTestDataFilePath=”path.xls” ‘Payments and TTFX Scenarios – Driver Excel file

        sTestDataFilePath=”path.xls”
        Call fn_GetSetUpData ‘Get the Environment setup data

        ‘ sSQL = “SELECT * from [SCENARIOS$] where EXECUTION_FLAG = ‘Y’ order by STORY_ID Asc” ‘SQLQuery,g_TestEnvironment is global variable which contains value as INTG or UAT
        sSQL = “SELECT * from [SCENARIOS$] where EXECUTION_FLAG = ‘Y'” ‘SQLQuery,g_TestEnvironment is global variable which contains value as INTG or UAT
        Call fn_Connect_ExecuteQueryOnExcel(sTestDataFilePath,sSQL) ‘Execute the query and get test scripts whichever having EXECUTION_FLAG=Y
        Do until objRS.EOF ‘Loop the Excel records till reach at the end of the file
        Set valueOf=fn_ReadDataToDictionary ‘Dictionary object , this is public varaible , directly can use as valueOf(“<>”)
        print valueOf(“AFC_NAME”)
        g_AFC_NAME=valueOf(“AFC_NAME”)
        ‘DataTable.ImportSheet sTestDataFilePath, “SCENARIOS”, “Global”
        ‘g_BROWSER_MODE = Trim(DataTable(“Browser”))
        g_BROWSER_MODE=valueOf(“Browser”)
        Execute valueOf(“AFC_NAME”) ‘sAFCNAME is the Automated function name or Action name
        objRS.MoveNext ‘Move to Next Record

        Set objShell = CreateObject(“WScript.Shell”)
        objResult = objShell.sendkeys(“{NUMLOCK}{NUMLOCK}”)
        Set objShell = Nothing
        Loop
        fn_Dispose_ADODB_objects

        The AFC name here is the function name which is actually a test case which is stored in my function library.

        I had a look at your junit function but how you used those variables.

        Like

      • Hi Lovesh

        You have to do the following

        1) Set the results as passed or failed when you execute a scenario(I am assuming that your scenario is equivalent to the test), i guess that will be below line

        Execute valueOf(“AFC_NAME”)

        Once you have the results for the scenario executions, you can save it in two dimensional array with the name of the scenario and the time taken to execute the scenario. So the array will look like this

        (“Sen1”, “Passed”, “10.11”) ‘ a single row in array.

        once the execution is done for the loop you will have the list of scenarios and the results in an array.

        After you dispose the ADODB Objects you can call the function for creating the JUnit files and moving these files to the jenkins workspace.

        After that use the publish JUnit results option in Jenkins to publish the results.

        Let me know, if you need anything else.

        Like

      • Hi Sumeet,

        Thanks mate.

        I wasnt able to reply on your latest reply so posting here.

        I set a result after execution of each scenario and stored the value in an 2 dimensional array.
        Now using your Junit function image whoch you mention earlier. I created a Junit function. But I dont know how this function will create a Junit file.

        Can you share me function to create Junit file so that i can then move that to jenkins.

        Many thanks in advance.

        Please find below my code

        On Error Resume Next
        Dim objResult

        Call fn_Initialise_ADODB_objects ‘Initialise ADODB objects
        ‘ sTestDataFilePath=”H:\NIB\TestData\NIB_PAYT_TTFX_SCENARIOS.xls” ‘Payments and TTFX Scenarios – Driver Excel file

        sTestDataFilePath=”P:\AGILE_ITAF\NIB\TestData\PAYT_TTFX\NIB_PAYT_TTFX_SCENARIOS.xls”
        Call fn_GetSetUpData ‘Get the Environment setup data

        ‘ sSQL = “SELECT * from [SCENARIOS$] where EXECUTION_FLAG = ‘Y’ order by STORY_ID Asc” ‘SQLQuery,g_TestEnvironment is global variable which contains value as INTG or UAT
        sSQL = “SELECT * from [SCENARIOS$] where EXECUTION_FLAG = ‘Y'” ‘SQLQuery,g_TestEnvironment is global variable which contains value as INTG or UAT
        sSQLCount = “SELECT Count(*) from [SCENARIOS$] where EXECUTION_FLAG = ‘Y'”
        sSQLCountTest = 0
        Call fn_Connect_ExecuteQueryOnExcel(sTestDataFilePath,sSQL) ‘Execute the query and get test scripts whichever having EXECUTION_FLAG=Y
        Dim sStatusArray()

        Do until objRS.EOF ‘Loop the Excel records till reach at the end of the file
        Set valueOf=fn_ReadDataToDictionary ‘Dictionary object , this is public varaible , directly can use as valueOf(“<>”)
        print valueOf(“AFC_NAME”)
        g_AFC_NAME=valueOf(“AFC_NAME”)
        ‘DataTable.ImportSheet sTestDataFilePath, “SCENARIOS”, “Global”
        ‘g_BROWSER_MODE = Trim(DataTable(“Browser”))
        g_BROWSER_MODE=valueOf(“Browser”)
        ‘ Call CreateTestResult(“Payments”, AFC_NAME,”0″)
        sFlagTestCasePassOrFail = 0
        Execute valueOf(“AFC_NAME”) ‘sAFCNAME is the Automated function name or Action name
        ReDim Preserve sStatusArray(sSQLCountTest,sSQLCountTest)
        If sFlagTestCasePassOrFail 0 Then
        sStatusArray(sSQLCountTest,sSQLCountTest) = array(g_AFC_NAME, “FAIL”)
        Else
        sStatusArray(sSQLCountTest,sSQLCountTest) = array(g_AFC_NAME, “PASS”)
        End If
        sSQLCountTest = sSQLCountTest + 1
        objRS.MoveNext ‘Move to Next Record

        Set objShell = CreateObject(“WScript.Shell”)
        objResult = objShell.sendkeys(“{NUMLOCK}{NUMLOCK}”)
        Set objShell = Nothing
        Loop
        fn_Dispose_ADODB_objects ‘Release ADODB objects

        MsgBox sStatusArray(0,0)(0)
        MsgBox sStatusArray(0,0)(1)

        Public Function JunitResult()
        sJunitVar = “” & vbCRLF & _
        ” ” & vbCrLF
        For l = 0 To sSQLCountTest
        If instr(1, sStatusArray(0,0)(1), “PASS”, 1) 0 Then
        sJunitVar = sJunitVar & ” ” & vbCrlf
        Else
        sJunitVar = sJunitVar & ” ” & vbCrlf
        End If
        Next
        End Function

        Like

  18. Hi – Thanks for sharing. I did encountered the below error while connecting to ALM though. Doubled checked the ALM url it’s the correct link. Thank you in advance.

    Timeout is set to: -1
    Run mode is set to: RUN_LOCAL
    Invalid server response
    Error: “ALM server http:///qcbin/start_a.jsp unreachable, check that server Url is correct”
    Build step ‘Execute HP functional tests from HP ALM’ changed build result to FAILURE
    Finished: FAILURE

    Liked by 1 person

    • I am assuming, you have tried running the tests from ALM not from file system, and you are able to connect and work on ALM/QC in the machine where you want to execute the UFT scripts.

      Below solutions must be implemented on the slave machine, where you want to execute the scripts

      Solution :
      I have received the same error, while running the tests from ALM for the first time.

      Go to the below URL

      http://../qcbin/start_a.jsp?Common=true

      for reinstalling the ALM files.

      What you have to do next is Go to the ALM URL till QCBIN

      http://../qcbin

      Click on Tools and download and installl ALM connectivity tool. Once you complete these two tasks, Open UFT and connect it to ALM once. And check if “Allow other HP products to run tests and components” is checked.

      Now, connect the UFT/QTP to ALM/QC.

      Once everything is done, you should be able to execute the ALM tests from UFT.

      Reason for the error :

      You need to install the ALM connectivity files for running UFT tests stored in ALM.

      Let me know, if this resolves your issues or if you face any other issues

      Like

  19. Hi – thank you for sharing. I did encountered an error while connecting to ALM though. Checked the ALM server the link is correct. Thank you in advance.

    Timeout is set to: -1
    Run mode is set to: RUN_LOCAL
    Invalid server response
    Error: “ALM server http://:8080/qcbin/start_a.jsp unreachable, check that server Url is correct”
    Build step ‘Execute HP functional tests from HP ALM’ changed build result to FAILURE
    Finished: FAILURE

    Like

  20. Hi Sumeet,

    Could you please suggest me to get path of my UFT results path back to jenkins. We are saving the results in the shared drive. We would like to publish in the HipChat.

    thanks
    suresh

    Liked by 1 person

    • Hi Suresh

      if you want to publish the results files back to jenkins, then first you have to copy the files back to the jenkins workspace. once the files are in jenkins workspace folder, you can select the post build action “archieve the artifacts” and provide the file types you want to archive.

      let me know if you have any questions.

      Like

  21. Hello Summet, I was planning to use same process for HP Load runner initiation through Jenkins, please advice if LR need to be on the same server as Jenkins for the test to be executed. As that is not the case with the set up here, was wondering how to get Jenkins to communicate with HP Load runner machine.

    Liked by 1 person

  22. C:\LogPortal>C:\LogPortal\HpToolsLauncher.exe -paramfile props28102015104833951.txt
    “Started…”
    Timeout is set to: -1
    Run mode is set to: RUN_LOCAL
    Error: folder cannot be found in ALM
    ================================================
    Run status: Job failed, total tests: 0, succeeded: 0, failures: 0, errors: 0
    ================================================

    Liked by 1 person

  23. Hi Sumeet, I am using Execute HP Functional test from HP ALM, is there any way to select the remote host with a given parameter? I can only write it manually.
    Thanks!

    Like

  24. Hello Sumeet,

    That plugin is not working for what I want, that is for hardcoding a variable.
    What i need is to be able to set the “Testing tool host” field with a parameter that I will set every time I execute the Jenkins Job

    Like

  25. Hi Sumeet,
    Is there a way to automate following steps in Jenkins.? Since we share VM with other team, this option was changed every time
    Open UFT, select Tools->Options, Check the option for Allow other HP products to run tests and components

    Thanks

    Liked by 1 person

    • Hi

      This needs to be configured manually… But you can also use the scripts to set this before the execution. When you goto Tools->options, there will be a button to generate the scripts. One the scripts are generated you can execute it to set this option.

      Like

      • I generated the script after I check the option ‘Allow other HP products to run tests and components’. However, I don’t see it in the below script. Is this correct?
        Dim App ‘As Application
        Set App = CreateObject(“QuickTest.Application”)
        App.Launch
        App.Visible = True
        App.Options.DisableVORecognition = False
        App.Options.AutoGenerateWith = False
        App.Options.WithGenerationLevel = 2
        App.Options.TimeToActivateWinAfterPoint = 500
        App.Options.SaveLoadAndMonitorData = True
        App.Options.TextRecognitionOrder = “OCROnly”
        App.Options.TextRecognitionLanguages = “English”
        App.Options.TextRecognitionBlockType = “Multiple”
        App.Options.DisplayKeywordView = True
        App.Options.AutoParameterizeSteps = False
        App.Options.AutoParameterType = “Data Table”
        App.Options.ActiveScreen.CapturedFilesStorage = “Compressed”
        App.Options.ActiveScreen.CaptureLevel = “Minimum”
        App.Options.Run.ImageCaptureForTestResults = “OnError”
        App.Options.Run.MovieCaptureForTestResults = “Never”
        App.Options.Run.MovieSegmentSize = 2048
        App.Options.Run.RunMode = “Normal”
        App.Options.Run.SaveMovieOfEntireRun = True
        App.Options.Run.StepExecutionDelay = 0
        App.Options.Run.ViewResults = True
        App.Options.Run.AutoExportReportConfig.AutoExportResults = False
        App.Options.Run.AutoExportReportConfig.StepDetailsReport = True
        App.Options.Run.AutoExportReportConfig.DataTableReport = True
        App.Options.Run.AutoExportReportConfig.LogTrackingReport = True
        App.Options.Run.AutoExportReportConfig.ScreenRecorderReport = True
        App.Options.Run.AutoExportReportConfig.SystemMonitorReport = True
        App.Options.Run.AutoExportReportConfig.ExportLocation = “”
        App.Options.Run.AutoExportReportConfig.UserDefinedXSL = “”
        App.Options.Run.AutoExportReportConfig.StepDetailsReportType = “HTML”
        App.Options.Run.AutoExportReportConfig.StepDetailsReportFormat = “Short”
        App.Options.Run.AutoExportReportConfig.ExportForFailedRunsOnly = True
        App.Options.Run.ScreenRecorder.DeactivateShowWindowContents = True
        App.Options.Run.ScreenRecorder.RecordSound = False
        App.Options.Run.ScreenRecorder.SetPlainWallpaper = True
        App.Folders.RemoveAll

        Liked by 1 person

      • Hi Kat,

        You can download the Slave-Agent.Jar and run that file, by double clicking the file and click on File->Install to install the salve as a service, once the slave is installed as windows service you don’t have to start the service manually every time and service will start automatically as soon as you will login to windows.

        Let me know, if you need any other details.

        Like

    • Hi,

      So, I also don’t see the option to set “Allow other HP Projects…”, but I found that this test run setting, can be set by editing the below registry key

      HKEY_CURRENT_USER\Software\Mercury Interactive\QuickTest Professional\MicTest

      Set AllowTDConnect to 1

      I have tested it with UFT 12.01 and its working as expected.

      you can create the scripts to edit the registry

      Like

      • I found the registry key QuickTest Professional\MicTest, but did not see this value – AllowTDConnect
        I have UFT 11.5. is there another value for version 11.5?

        Liked by 1 person

      • Hi,

        Mine looked like this

        null

        Also make sure that you are under HKEY_CURRENT_USER\Software\Mercury Interactive\QuickTest Professional\MicTest

        If you cant find it, then can you send me the screenshot of how it looks in your system ?

        Like

      • Hi Sumeet,
        I had to set up a VM as a node on Jenkins server. I tried to run this command : java -jar slave.jar -jnlpUrl http://**Jenkins server**/computer/**computername**/slave-agent.jnlpI, but I kept getting exception. java.io.IOException,Failed to connect to **Jenkins Server**.
        Do you have any suggestions on this?

        Like

      • Hi Sumeet,
        In UFT-Tools-Options-GUI Testing-ScreenCapture, I need to set the Save still image captures to results to ‘Always’. Is there a registry key for this one? Thanks

        Like

  26. Hi Sumeet

    I am seeing below error message. Any idea abt this.

    Test description: ALM_PC12
    Validating parameters before run
    Trying to login
    [PCServer=’/loadtest’, User=”]
    Login succeeded
    Sending run request
    [Domain=”, Project=”, TestID=’5′, TestInstanceID=’5′, TimeslotDuration=’0:30(h:mm)’, PostRunAction=’Collate And Analyze’]
    Logout succeeded
    Empty Results
    Result Status: UNSTABLE

    Like

  27. Hi Sumeet,

    Very clear and detailed article.

    Regarding the command to unlock the remote machine, is there a way that the remote machine running UFT can be unlocked from Jenkins ? The requirement is for the entire process to be automated without any manual intervention (i.e unlocking the remote machine).

    Regards

    Like

    • Hi Sri,

      The Command I mentioned here cannot be executed remotely, you will have to be logged in to the machine. You can also try to go to tools->options->General ->Run Sessions->Allow UFT to Continue running the tests after Disconnecting the RDP.

      If you are using ALM Lab management then you can try to provide the User ID and password in the Lab management client and check if that works. But it generally cannot be done because of the security policies enforced by the system admins.

      Let me know, if you need any other details.

      Like

  28. Hi Sumeet,

    I am facing below error while running the Performance Test using file system. The Analysis part is failing –

    23/11/2015 18:36:48 Running: C:\Vugen\Scenarios\JenkinsSanity.lrs
    Cleaning up the environment…
    Preparing scenario C:\Vugen\Scenarios\JenkinsSanity.lrs for execution.
    Load Generator localhost connected
    Starting scenario…
    Scenario C:\Vugen\Scenarios\JenkinsSanity.lrs ended after 0:6:30.
    ============================================================================
    Analyzing results…
    closing Controller
    Controller closed
    calling analysis report generator
    Error: Error during Analysis run. See output console for details
    Analysis Results:

    starting analysis launcher
    HP LoadRunner Analysis Command Line Executer

    Usage: LRAnalysisLauncher.exe[.lrr file location] [.lra output location] [html report output folder]
    analysis report generator finished
    Error(s) summary:
    0 ignored , 0 errors

    Like

  29. Hi Sumeet,
    This is a good article i found.
    could you please explain how do we create a slave machine and how to configure in order to execute UFT script in file system.

    Like

  30. Hi Sumeet,
    In UFT-Tools-Options-GUI Testing-ScreenCapture, I need to set the “Save still image captures to results” to ‘Always’. Is there a registry key for this one? Thanks

    Like

  31. Hello Sumeet,
    First of all I want to thank you for your post, it is been really helpful.
    I have followed your steps to automate the tests in continuous integration, I have a rotation system to test each time in a different OS, and it happes that the 64bit OS work just fine, but with the W7x86 my jenkins job fails with the following error:

    Report not found
    Build step ‘Publish HP tests result’ changed build result to FAILURE
    Finished: FAILURE

    Hope you know any trick to fix it, thanks again

    Like

    • Hello sumeet,

      I can launch tests from my ALM to a remote server, but if I try to do the same from jenkins with the ALM plugin I got an error message:
      Error, Message: The RPC server is unavailable

      Like

  32. Hi Summet,

    Thanks for the post it helps a lot.
    I have Jenkins(Standalone version: means Windows Services) and UFT all in one of WIN 8 VM.
    If I run the ALM Test Set from Jenkins through web console, I will receive the “Could not lock the host. Another test may be running. Try later” error msg .

    But, if I run the test case using command line, (launch cmd using local user), then run C:\Jenkins\workspace\POC\HpToolsLauncher.exe -paramfile props1903201511276304.txt
    Then it works.
    What do you think it is missing.

    Thanks in Advance,
    Satish Bogaiah

    Like

  33. Hello Sumeet,
    In Jenkins, we also have the sonarQube configured with it. Do you know a way to include the sonarQube report in the Jenkins e-mail report?

    Thanks

    Like

    • Hi Kat,

      If you have the report saved to the Jenkins Workspace path, You can include it in the Jenkins emails.

      If you have the path for the sonarQube reports, then you can write a simple script for moving it to the Jenkins workspace folder.

      Like

  34. Hi Sumeeth,

    thanks a lot for sharing this information, unfortunately i am not able to find below 3 steps in configure page.
    Check on “Restrict where this project can be run” and provide the slave machine name with UFT installed. This is very important step, because otherwise Jenkins will choose a slave machine randomly, and might choose Jenkins master machine (where Jenkins is installed) for execution. This will cause the job to fail.

    3) Select appropriate build triggers, if you are using any source code control for storing UFT tests (Except ALM) e.g. GIT, SVN, TFS.

    4) Under Build environment select “delete workspace before build starts”. This will help us in cleaning up the workspace and have a fresh start for each execution.

    when i do the configuration and build i am getting this error:
    Build step ‘Execute HP tests from file system’ changed build result to FAILURE
    Finished: FAILURE

    do you have any video on the same? please if you have.

    Like

  35. Hi Sumeet:
    Thanks for your awesome documentation. I have a basic and may be a simple query. If selected with the build action as “Execute HP Functional test from HP ALM”, do one need to install HP UFT on the jenkins slaves?

    Like

      • Hi Sumeet,

        For executing the UFT tests from ALM test set below are the pre-requisite.

        1) ALM/Quality Center client installed the machine that will run the tests. To check if you have a client installed, follow the instructions on this page: http://:8080/qcbin/TDConnectivity_index.html
        2) For running UFT tests from ALM install the ALMClient in common registration mode by accessing the following link from an InternetExplorer browser on the UFT machine: http://:8080/qcbin/start_a.jsp?Common=true

        I use the ALM test lab for the running the UFT tests, is this the same as ‘ALM/Quality Center client’. I am confused between the ALM and the ALM client (web?)

        For point#2, I am always getting error and it says ALM stopped working and will be closed.

        I am not an administrator for Jenkins, just an user to run the Jobs. One such independent job is to trigger a UFT test placed in ALM when ever required, not dependent on the application build and deployment success.

        Case2: I have a slave machine configured which has ALM and UFT installed on it. In the test lab for the test, under the Planned Host Name what should I give. I suppose it should be Blank
        and what should be the value in Run Mode and the Testing Tool Host
        Please let me know if you have any questions!

        Thanks
        Chandra

        Like

  36. Hi Sumeet,

    Thanks for the detailed documentation. While running ALM test sets from Jenkins, I’m getting below error. ALM data is fine w.r.t. folder structure. Can you please suggest how do I unblock.

    Run mode is set to: RUN_LOCAL
    Error: folder cannot be found in ALM
    ================================================
    Run status: Job failed, total tests: 0, succeeded: 0, failures: 0, errors: 0
    ================================================
    Build step ‘Execute HP functional tests from HP ALM’ changed build result to FAILURE

    Like

  37. Hi Sumeet,

    I have created a pipeline view in Jenkins which has four jobs(steps).
    Each step executes different GUI UFT script one after another via ALM.
    Each step takes around 2 mins to run individually and pipeline takes around 8 mins in total to run
    When i run these four GUI UFT scripts directly in UFT by creating flow in GUI, it takes around 30 seconds in total to run.
    Is there any way to reduce overhead time ?

    P.S I know its possible to to trigger complete flow of UFT scripts from Jenkins in one step but that is not preferred option for us

    Like

  38. Hi Sumeet,

    Getting below ERROR while scheduling job thru jenkins .
    Could not create scheduler, please verify ALM client installation on run machine by downloading and in installing the add-in form: https://qualitycenter-alm.lfg.com/qcbin/TDConnectivity_index.html
    Build step ‘Execute HP functional tests from HP ALM’ changed build result to FAILURE
    Finished: FAILURE

    As per failure, tried executing scripts after TDConnect addin Installation though it is not working. Please assist me to proceed further. Thanks in advance

    Like

  39. Hi Sumeet,

    Are you familiar with running multiple tests that fail? Currently if I have 8 tests, and the first 2 fail (recovery scenarios work perfectly), but the remaining 6 don’t get ran and they are marked as “error”.

    It doesn’t mention why they are an error, is this a limitation of the plugin do you know?

    Thanks for your excellent help, Niall.

    Like

  40. Hi Sumeet,

    I’m running single file tests from QTP, but I’m having a problem getting my test results to display in the browser, once the test has run and I click on UFT Report -> *Report Name* in the browser, I get an empty doc – nothing on the browser. I see the expected content in view source, and I can see the actual report if I open with the browser directly from the file system. But nothing when I click on the report results in the browser. What am I missing?

    Thanks,
    SS

    Like

  41. Hello Sumeet,
    Thank you for detailed document. I am having the same issue as Chandra in the above comment (Dated Feb26th 2016). I can take then hptoolslauncher.exe command and run it on the command prompt of the slave machine and it works fine. However when I run the Jenkins job, I get the “could not create scheduler” message. I have installed the right plugins as an administrator. I have been working on resolving this issue for a long time now and have had no luck. Hoping you can assist me.. Please let me know if there is anything else I should be doing to get this working.

    Like

    • Hi Ramya,

      Please try the following steps

      1) in run prompt type services.msc
      2) click on Jenkins service
      3) right click and open properties
      4) click on logon tab
      5) change the logon from local system account to user and add your ID and password for Windows login there.
      6) click ok and restart the service and then system.
      7) execute the job.

      Please let me know if above steps worked.

      Like

      • Hello Sumeet
        I forgot to mention that we are not using local system account and have a service account that is being used for Jenkins slave. So all the steps mentioned above are already taken care of and we have not had luck with this as well.

        Thanks
        Ramya

        Like

      • Hi Sumeet,
        Are you familiar with the WebSphere Deployer Plugin in Jenkins? I tried to deploy an EAR file on Websphere 8.5 with Webshepre Deployer plugin beta version 1.4.0, I received the error. java.lang.ClassNotFoundException. Do you have any suggestions?

        Like

  42. Hi Sumeet,
    During our CI progress I’m starting to configure Jenkin to run our UFT tests
    I come into the error:The HP Unified Functional Testing computer is locked or logged off
    as I see in UFT–>Tools–>Options–> the Checkbox is set ON and the user name and password exist
    I tried also to lock the remote machine and run again and could not reproduce the err, another strange thing is that the err occured to me on two out of three tests related to the same phase (multiJob plugin) while the all are restricted to run ont he same slave (VM) .
    Do you have an idea what can be the reason?

    Thanks in advanced
    MA

    Like

  43. Hi Sumeet,
    During our CI progress I’m starting to configure Jenkin to run our UFT tests
    I come into the error:The HP Unified Functional Testing computer is locked or logged off
    as I see in UFT–>Tools–>Options–> the Checkbox is set ON and the user name and password exist
    I tried also to lock the remote machine and run again and could not reproduce the err, another strange thing is that the err occured to me on two out of three tests related to the same phase (multiJob plugin) while the all are restricted to run ont he same VM.
    Do you have an idea what can be the reason.

    Thanks in advanced
    MA

    Like

  44. Hi,
    I’m encountering a new problem during execution of Test Scripts from Test LAB of ALM. Suppose I’m put a script in run in ALM test Lab, it’s running through Automatic Runner. But after execution of steps “Automatic Runner” window remains open and showing “Uploading report.” though in test lab if I refresh the test it’s showing the results (Pass/Fail) and also can see the results are updated in “Last Run Report” section. I’ve tried with un- installation of ALM and UFT (both)
    also but it didn’t produced any result.

    Please let me know if you have any resolution for this issue.

    Avinandan

    Like

    • Hi

      It never happened with me, but you can try the following and let me know the results

      1) goto URL /qcbin/addins.html
      2) install HP Alm connectivity and HP ALM client registration.
      3) install UFT addins for ALM
      4) open UFT and connect ALM once (use admin rights for this)

      Try to run it again on the machine where you have performed the above steps

      Let me know the results.

      Thanks
      Sumeet

      Try it once agai.

      Like

      • Thanks Sumeet, for your prompt response(s).

        The UFT Report shows all PASSED verifications. There are no failed ReporterEvents. There isn’t an issue in any way with the UFT script. If I run the script on the slave directly via UFT it runs fine. And when it’s run via Jenkins the UFT Report always reports no failed steps or verifications. The UFT Report shows 100% passed. But the Jenkins Console reflects a test FAILURE. Weird things is if I run the same exact Jenkins job 10 times in a row, 2-3 will show SUCCESS in the Jenkins console, and 8 will show fail. So, the results (Jenkins Console) are unpredictable. I could send you the UFT Report, but it will simply show PASSED 100% of the time. It’s the Jenkins Console that reflects a FAILURE.

        Like

      • Ok. For the test which is failing randomly

        once the test results are failed in Jenkins

        Goto Jenkins workspace on the slave machine and open the folder with the job name. You will see the file named Resultsxxxx.xml

        check the contents of this file for node failuremessage. If this says Test failed then that’s the output of the HP tools plugin and it’s not Jenkins fault.

        Next what you can do is create an test in UFT (search something in Google) and put that for executions say 20 times and see if this also yields results as failed..

        Make sure that you have atleast one reporter.reportevent mic pass in this test…

        This will let us now if there is a genuine issue with HP plugin for Jenkins or if it’s something special with your test.

        We can open a ticket if this is a genuine issue otherwise we can check your UFT results file after this.

        Let me know the results..

        I have replied to someone else with the suggestions to install ALM plugin.. I think the responses got mixed up.

        Thanks
        Sumeet

        Like

      • Thanks very much Sumeet.

        Yes, I suspected that the Results.xml file (Junit) is what is read by Jenkins and then translated as a test FAILURE in Jenkins – – see sample below:

        14/06/2016 08:10:49 Running: C:\POC_UFT_Smoke_Test
        Running test: C:\POC_UFT_Smoke_Test
        Test result: Failed
        14/06/2016 08:11:07 Test complete: C:\POC_UFT_Smoke_Test

        So the question is, why does Junit report FAILED when the UFT Report clearly shows PASSED for the test? That is, every reporter event w/in the UFT Report reflects a “micPass”.

        It is not an issue with the UFT script. I can run the UFT script multiple times on the slave machine within UFT (not thur Jenkins) and it passes 100% of the time. The script is fine.

        And as previously stated, I can run the same exact Jenkins job 10 times in a row. 2-3 times, both the UFT Report and Jenkins console show PASSED. 7-8 times, the UFT Report will show PASSED and the Jenkins report will show FAILED. To me , this points to an issue with the HP Plug-In (not the UFT script, or the Jenkins job configuration).

        Is there a way that I can upload files to your site so that I can show a UFT Report (showing PASSED) and a snapshot of the Jenkins console (showing FAILED)?

        Like

      • Thanks, Sumeet, for your latest response. It looks like you may have pointed me to something useful on Google Drive! Unfortunately, access to google drive is blocked via our company’s internal firewall :>(.

        Like

      • Hi Sumeet,
        Although I am blocked from Google Drive here at work, I attempted to following the google drive link that you provided from my home. It indicated an “empty” WordPress? Is there a another way to share the content of what you were trying to direct me to?

        Thank You.

        Jim

        Like

      • Also if script is generic enough like searching on google which fails in your Jenkins setup then if you can upload the script I will run it to check if it fails with my setup also. This will confirm the issue.

        Like

      • Hello Sumeet,

        I am able to get the UFT test to run successfully. I ultimately added a brief wait and “ExitTest” command at the end of the script, and now the Junit results are being appropriately updated and passed back to the Jenkins master. Thank you for your time.

        Jim

        Like

      • Sumeet,
        I can only guess that the WAIT and EXITTEST commands allowed for the Junit results to be assembled in a more graceful manner upon the conclusion of the script.

        Jim

        Like

      • Thanks Sumeet.

        We are not running anything related to ALM. We are simply running UFT scripts off the file system. I don’t see how the ALM Client registration would influence how this native UFT script is running via the HP Plug-In (HpToolsLauncher).

        I have also opened a ticket with HP Support…since the authors of the plug-in all seem to be HP staff.

        Like

      • Hi Sumeet,

        I’ve tired with full uninstallation of ALM and UFT. But I’m getting same results.

        Can you suggest?
        Thanks and regards,

        Avinandan

        Like

  45. Hello Sumeet,

    Hoping you can help here. We are running native UFT (12.02) scripts from Jenkins, using the HP Automation Application Tools plug-in (v4.0.1). The UFT tests are triggered to run on a slave (windows machine). The UFT tests run fine, and the “UFT Report” shipped back to the Jenkins master machine shows all PASSED. But, the Jenkins console reflects a test FAILURE. The Results.xml (Junit) on the slave also shows a failed test…so I assume that this is what Jenkins reads and records in the Jenkins Console. Weird thing is, that sometimes the Jenkins Console reflects a SUCCESSFUL run of the job, and sometimes not. I have searched for folks posting similar behavior on the web, but haven’t seen any reports. Have you ever encountered this, that while the UFT Report reflects a PASSED test, that the Jenkins Console reflects a FAILED test? Thanks very much.

    Like

    • When you use the UFT run results in Jenkins by choosing the post build step “publish hp test results” even a single reporter.reportevent micfail will result in the failure of the job. It does not matter that other steps after it passed. Also if you have any dialogboxes in the scripts then Jenkins will directly show failure. That’s how the code is written. And there are other issues with this as well, that’s the reason I will create a separate junit results for at the end of each test which is not related to the UFT run results. I will only pass test name and status to this junit file. I will use the post build step in Jenkins “publish junit test result report”. This will make sure that the status which I wanted to post on Jenkins is there. I will also upload the html version of the UFT run results and this will help me in the analysis of the failed tests.

      Let me know if you need anything else

      Thanks,
      Sumeet singh kushwah

      Like

    • Thanks, Sumeet.

      There are no failed ReporterEvents. The UFT Report sent back to the Jenkins master shows all PASSED. But, the Jenkins Console shows test FAILURE. It’s not a UFT script issue in any way.

      If I run the same exact Jenkins job several times in a row, some will shows PASSED in the Jenkins console and some will show FAILURE.

      Like

  46. Hi Sumeet,

    i have seen on blogs that you worked on Jenkins with UFT.

    currently i am working on the same but facing the following problems,

    1. launching QTP to execute the script stored on local drive, getting
    following error,

    “Console Output
    Started by user anonymous
    Building in workspace C:\Program Files (x86)\Jenkins\jobs\Test\workspace
    [workspace] $ cmd /c call C:\WINDOWS\TEMP\hudson5783736671226745325.bat

    C:\Program Files (x86)\Jenkins\jobs\Test\workspace>CScript
    C:\workspace\qtpjen\runner.vbs
    Microsoft (R) Windows Script Host Version 5.8
    Copyright (C) Microsoft Corporation. All rights reserved.

    C:\workspace\qtpjen\runner.vbs(5, 1) HP Unified Functional Testing:
    Neither QTP license nor UFT license is installed, can’t run QTP
    Automation.

    C:\Program Files (x86)\Jenkins\jobs\Test\workspace>exit 0
    Finished: SUCCESS

    2. I am trying to execute the scripts located in ALM, getting
    following error, even though the ALM url is correct

    “FailedConsole Output
    Started by user anonymous
    Building in workspace C:\Program Files (x86)\Jenkins\jobs\ALM_Job\workspace
    [workspace] $ “C:\Program Files
    (x86)\Jenkins\jobs\ALM_Job\workspace\HpToolsLauncher.exe” -paramfile
    props23062016091045174.txt
    “Started…”
    Timeout is set to: -1
    Run mode is set to: RUN_LOCAL
    Server has been disconnected while performing GetServerSettings action
    Error: “ALM server http://sm09520.dom1.e-ssi.net:8080/qcbin
    unreachable, check that server Url is correct”
    Build step ‘Execute HP functional tests from HP ALM’ changed build
    result to FAILURE
    Finished: FAILURE”

    Could you please help me.

    Thanks & Regards,
    Chandrakant

    Like

  47. Hi Sumeet,

    i have seen on blogs that you worked on Jenkins with UFT.

    currently i am working on the same but facing the following problems,

    1. launching QTP to execute the script stored on local drive, getting
    following error,

    “Console Output
    Started by user anonymous
    Building in workspace C:\Program Files (x86)\Jenkins\jobs\Test\workspace
    [workspace] $ cmd /c call C:\WINDOWS\TEMP\hudson5783736671226745325.bat

    C:\Program Files (x86)\Jenkins\jobs\Test\workspace>CScript
    C:\workspace\qtpjen\runner.vbs
    Microsoft (R) Windows Script Host Version 5.8
    Copyright (C) Microsoft Corporation. All rights reserved.

    C:\workspace\qtpjen\runner.vbs(5, 1) HP Unified Functional Testing:
    Neither QTP license nor UFT license is installed, can’t run QTP
    Automation.

    C:\Program Files (x86)\Jenkins\jobs\Test\workspace>exit 0
    Finished: SUCCESS

    2. I am trying to execute the scripts located in ALM, getting
    following error, even though the ALM url is correct

    “FailedConsole Output
    Started by user anonymous
    Building in workspace C:\Program Files (x86)\Jenkins\jobs\ALM_Job\workspace
    [workspace] $ “C:\Program Files
    (x86)\Jenkins\jobs\ALM_Job\workspace\HpToolsLauncher.exe” -paramfile
    props23062016091045174.txt
    “Started…”
    Timeout is set to: -1
    Run mode is set to: RUN_LOCAL
    Server has been disconnected while performing GetServerSettings action
    Error: “ALM server http://sm09520.dom1.e-ssi.net:8080/qcbin
    unreachable, check that server Url is correct”
    Build step ‘Execute HP functional tests from HP ALM’ changed build
    result to FAILURE
    Finished: FAILURE”

    Could you please help me.

    Thanks,
    Chandrakant

    Like

    • Hi,

      For running QTP scripts from file system

      1) Have you installed UFT license as Admin on the machine ?
      2) what is runner.vbs. Are you using HP tools automation plugin to run the tests ..

      For running QTP scripts from ALM

      1) make sure that you are able to login to ALM on the machine manually.
      2) Download and install TDConnect.exe

      Let me know if you still face issues.

      Thanks,
      Sumeet singh kushwah

      Like

      • Hi Sumit,

        1) Have you installed UFT license as Admin on the machine ? – YES
        2) what is runner.vbs. Are you using HP tools automation plugin to run the tests ..
        Runner.vbs:

        ‘Create QTP object
        Set QTP = CreateObject(“QuickTest.Application”)
        QTP.Launch
        QTP.Visible = TRUE

        QTP.Open “H:\MDM Automation\TestScripts\MDM Client\GUITest2”, TRUE ‘Set the QTP test path

        Set qtpResultsOpt = CreateObject(“QuickTest.RunResultsOptions”)
        qtpResultsOpt.ResultsLocation = “Result path” ‘Set the results location
        QTP.Test.Run qtpResultsOpt
        QTP.Test.Close
        QTP.Quit

        For running QTP scripts from ALM

        1) make sure that you are able to login to ALM on the machine manually. – YES i am albe to login to the ALM and able to execute the same script, which invokes the UFT.
        2) Download and install TDConnect.exe – I have done this before, but still getting the error
        “Error: “ALM server http://sm09520.dom1.e-ssi.net:8080/qcbin/ unreachable, check that server Url is correct”
        Build step ‘Execute HP functional tests from HP ALM’ changed build result to FAILURE
        Finished: FAILURE”

        Like

      • Ok. So in this situation I will start debugging like this

        1) Remove the Runner.vbs and use the option to run the UFT test from file system. This will check a lot of things like, if the UFT is able to run using the plugin installed or not. Once you have this going on then we can debug the UFT running from ALM issue.

        Let me know if you are able to run the test using the file system option.

        2) Try running the UFT tests From ALM test lab, this will confirm any issues if you have with ALM setup. If your UFT test runs fine from ALM test lab, then we can discuss about the other options.

        Please let me know the results.

        Thanks,
        Sumeet singh kushwah

        Like

  48. Hi Summet,
    i have removed the runner.vbs &

    Execute it by option – run the UFT test from file system & its working fine.

    How can i run this from ALM now?

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s