How to run QTP scripts from Jenkins installed on linux? - jenkins

I have Jenkins on linux and i want to run QTP scripts (windows shell command) through the jenkins.
Please suggest

1. Install HP Application Automation Tools plugin in Jenkins
Jenkins -> Manage Jenkins -> Manage Plugins -> Install
a) Configure your ALM server, Jenkins -> Manage Jenkins -> Configure System -> Application Lifecycle Management
2. Add a jenkins agent in a windows machine - Machine 1
You can use JNLP to launch slave agent
3. Add Machine 1 as a new node in Jenkins master
Jenkins -> Manage Jenkins -> Manage Nodes -> New Node When creating give a meaning label for the node, which will be later used in the Jenkins job.
4. Create a new Jenkins job, Plug in all the mandatory values, select Restrict where this project can be run and enter the label created in step 3
5. In the build step select Execute HP functional tests from HP ALM Enter the username, password, domain, project and test set details

Related

Jenkins - How to pick Kubernetes server to deploy to?

I have installed the Kubernetes plugin as well as added 2 kubernetes slave nodes in the Jenkins -> Manage Jenkins -> Configure system -> Cloud.
Then when adding jobs I can't see a place to configure the target environment. There's simply no tabs as seen for example here:
Here's what it looks on my job configuration:

Jenkins MsBuild.exe issue

I'm using Jenkins 2.7.2 installed as a Windows service via the Windows Installer. Jenkins installed in my local PC only. I do not see anything in Jenkins -> Manage Jenkins -> Configure System having to do with MSBuild. I've installed the MSBuild plugin, but don't see it in configure Jenkins. Is this a bug in 2.7.2
You should find this MsBuild section into Jenkins -> Manage Jenkins -> Global Tool Configuration.
Looks like it moved here with Jenkins 2

Running HP Load Runeer or QTP from Jenkins

I have HP Load Runner installed in Windows 2012 and its hosted in the cloud.
For running load runner scripts, I connect to the system via mstcs, open the Virtual User Generator application and run the scripts.
Now I want to run the scripts via Jenkins( installed in a different system ) and I tried using the Jenkins HP Application Automation Tools plugin but I was unable to figure out how to do that.
In Jenkins I found out the following option:
Execute HP functional tests from HP ALM
Execute HP tests from file system
Execute HP tests using HP ALM Lab Management
Execute HP tests using HP Performance Center
But I am not sure how to use them or any of these will work. Can some please help me with this?
For individual scripts alone, mdrv command line. For controller alone wlrun command line. You may refer to knowledge base articles on the arguments to employ.
Have you gone through the documentation for HP automation plugin for Jenkins?
At last I figured out how to integrate it.
Integrating HP Load Runner:
For Running HP Load Runner scrips there is a Jenkins plugin named HP Application Automation Tools.
The challenge for us was the fact that Jenkins and Load Runner were installed on separate machines. We had Jenkins installed in our Dev server and HP Load Runner installed on cloud. If both were installed on the same machine then the task would be as simple as providing the filesystem path for Load Runner Scenario *.lrs files, in Execute HP tests from file system plugin.
So I went ahead and installed a slave instance of Jenkins in our CTC in which Load Runner was installed.
Steps to setup Jenkins slave instance.
On your master machine go to Manage Jenkins -> Manage Nodes.
New Node --> Enter Node Name.
Select Dumb Slave --> Press OK.
Fill out the following:
Set a number of executors (one or more) as needed.
Set a Remote FS Root, a home directory for the master on the slave machine. For a Windows slave, use something like: "C:\Jenkins\"
Set a label so that you can use that label to run jobs on the slave machine.
Select the appropriate Usage setting.
Launch Method: An easy way to control a Windows slave is by using Launch slave agents via Java Web Start (Recommended for Windows).
Availability --> Keep this slave online as much as possible
Press OK.
Now you need to connect your slave machine to the master using the following steps.
Open a browser on the slave machine and go to the Jenkins master server url (http: //your jenkins master:8080/).
Go to Manage Jenkins > Manage Nodes, Click on the newly created slave machine. You will need to login as someone that has the "Connect" Slave permission if you have configured global security.
Click on the Launch button to launch agent from browser on slave.
Run the program.
Now you should see the Slave machine connected under Nodes.
If you want the service to run on start-up of the slave machine do the following (Windows only directions):
In the Slave agent program running on your slave machine, click File --> Install as Windows Service.
Start, type Services and Select the Services program.
Find Jenkins Slave in the list, Double click to open.
Select Startup type --> Automatic.
Go to the Log On tab, change the Log on as to a user of your choice (Special user account Jenkins recommended).
Make sure that auto login is set for the slave machine for the user account, then the VM (or physical computer) should connect and be available when needed.
Creating Load Runner job in Jenkins:
Create a new freestyle project in Jenkins.
Check the "Restrict where this project can be run" checkbox and choose the Label Expression what you have provided for Slave Jenkins.
Under Add build step select Execute HP tests from file system and inside the Tests textarea provide the path of the folder of cloud machine which is having your Load Runner Scenario *.lrs scripts .
Click on build, Jenkins will trigger the Jenkins slave instance in cloud machine which will in turn invoke the Load Runner Controller and run the controller scripts(*.lrs).
Integrating HP QTP Scripts:
Steps for integrating HP QTP Scripts are exactly same as for HP Load Runner, the only difference is :
HP Unified Functional Testing should be installed in the same machine where you are going to configure Jenkins as a slave instance.
Under Add build step select Execute HP tests from file system and inside the Tests textarea provide the path of the folder of CTC machine which is having your HP QTP scripts .
Running Windows Server 2012 R2 Datacenter in a VM & want it set up as a jenkins node to run HP ALM test sets. In step 6, setting jenkins slave to run as a service, I received 'access denied' from jenkins slave agent process. Open a cmd prompt as admin user, cd to the jenkins slave install directory and enter
jenkins-slave.exe install
to fix this. Next, run services, locate the jenkins slave service. Should say 'Automatic', so 'start' it up and trial run your jenkins job. Check by rebooting the new jenkins slave platform and checking the service comes back as 'Automatic'.

Jenkins- Create Jobs on different servers

I want to configure Jenkins to build my code on 1 server. Then want to deploy it on another server using Jenkins.Both servers are using Linux I want to automate the entire process as much as possible. I went through some of plugins like pipeline, Job Import Plugin, etc
Can anyone guide me how to go about it ? Which plugins will be useful ? Any example or tutorial somewhere will be useful. The configuration of build pipeline plugin on jenkins was not seamless for me.
Thanks,
Bhargav
I would work it this way :
Install jenkins on your first server
Install the following plugins : ssh credentials, ssh slaves, copy to
slave, and restart jenkins
Go to Manage jenkins -> Manage credentials, and add ssh credentials
for your second server
Go to Manage jenkins -> Manage nodes, and create a passive slave.
The launch method should be "Launch slave agents on Unix machines
via ssh". You should use the credentials that you have added in step
3
Create a job to build your code. In the advanded options of job, you
should indicate that the job must only be built on master node.
Create a job to deploy your code on the second server. In the
avanded options of job, you should indicate that the job must only
be built on slave node.
In the "Build Environment" section, check the "Copy files into workspace before building" box and configure what files you want to copy from first server (https://wiki.jenkins-ci.org/display/JENKINS/Copy+To+Slave+Plugin)
The code will be copied into the jenkins slave's workspace.

Distributed Jenkins- Master on Linux and slave on windows- How to configure node specific setting

This is background for my question.
I have setup distributed Jenkins where the master is running in RHEL linux box and slave is running on a windows box. I did not have any problem in registering the slave node to the master.
In master Jenkins, under manage Jenkins page, I have provided the maven path detail corresponds to master (/opt/maven3).
Now I have create maven2/3 job and assigned the job exclusively on slave node. But when slave is running the maven job on windows, it is taking the maven path installed the master (/opt/maven3), since this path is not valid in windows, throws up an error.
I tried to override the value with pre-build steps, setting M2_HOME and PATH environment entries. but in vein.
So in simple term, How do I configure the node specific settings in Jenkins?
Mean I want to specify in Node 1- Maven path is XXX/maven3 and in node-2 maven path is yyy/zzz/maven3.
Override the settings as follows:
System Management -> Node Management -> your slave setting -> Node Properties -> check the Tools Locations -> Add , then set the slave maven option,alias select "maven",directory write with the slave maven directory.
you can try it.

Resources