Jenkins GUI Automaion script execution - user-interface

I am new to Jenkins. My query is
What I am trying to achieve.
1) We have automation framework (GUI kindoff). Which will trigger UFT / Selenium Scripts.
2) I have installed Jenkins.
3) I need to run some batch commands which will execute UFT scripts via built in framework.
4) When running via command line I am able to trigger scripts (UFT).
5) From Jenkins I am not able to run GUI commands.(It should trigger my framework and start UFT script execution)
Please note:
Build is success. I am doing all this from Master Jenkins. no slave machine.
Is it necessary to have slave machine to run GUI
I tried almost all settings by searching google.
Please help.
thanks in advance.
Abhijit

if you are using webdriver in your selecium script thats requires UI to be success than you have to consider using Slave which will have UI support and you need to connect there via Xvnc or something similar
if you are using webdriver which does not require UI (for example google chrome headless) then there should be some miss configuration in jenkins side, therefor to help you figure it out you need to provide more details

Related

How to write a program to run same script using multiple external tools in eclipse

I write automated tests. We have different environments we run the tests in for different customers that we provide the same services to before they can be pushed to out automated testing servers. To ensure a test is working we need to run the tests using different external tools in eclipse each time and record and report on it passing/failing. To do this we need to click the green play button with the red toolbox and select an external tool individually each time.
I'm looking for a way that I can write a script that will let me specify which external tools to run the test with and then it'll run the test over and over with the different tools and output some kind of report. I'm not familiar with this kind of thing so any kind of direction would be a huge help.
I'm using Eclipse Keplar on Ubuntu 16.04. The test is a ruby script.
You can use scheduler of ubuntu system and execute shell script command to trigger automation.

Selenium with Windows Release Mangement

In Microsoft Release Management 2013, in the Powershell Executor step we have configured a step to trigger a Windows batch file. This batch file will be executed on a different server, which also happens be our App Server. As an experiment, we have a simple test case to open IE, access the Google homepage URL and close the browser, a screenshot will also be captured. When we run the job from RM, the Selenium logs say that the browser is launched and the test was successful. But when we check the screenshot it is just a black screen. All this runs as the Windows service account user which is the same user that is running RM. This user has no log on privilege.
If I log into the App server with my own ID and execute the batch file manually, the screen shot is captured correctly.
I have read several online posts regarding the black screen. People have said that the screenshot is black because the screen is locked. Does this mean the RM Powershell executor step must be executed with some other credentials instead of service account? If yes, how do we do this? In some suggestions it was mentioned to install VNC. Is that relevant in this situation?
I'm fairly new to Windows. I've mostly been working in Linux systems and I've been requested to debug this issue here. Any pointers/guidance will be appreciated. Thank you!
The deployment agent does not run as an interactive service. You're going to have a lot of trouble getting it to directly invoke Selenium tests. I wrote a blog post a few years ago showing how I accomplished it. Basically, you use Selenium hub to execute the tests interactively from agent machines.
We finally got this to work.
We were invoking the testNG selenium tests within a batch script. This script was specified in RM within the Powershell Executor task. The main point to note is that, in the Powershell executor task, we must first have a cd (change directory) command to change into the directory where the Selenium scripts are. Then specify the complete path to the batch script to be executed in the same Powershell executor task. This cd command is very important. Without this, the batch script would be executed but the selenium step within that wouldn't work. You would just get a vague "configuration errors:1" in the final output.
We took care of website authentication using AutoIT for IE browser.

How to run UFT script without having UFT installed

I want to know whether is there any way to run script written in UFT without having UFT installed in your PC.
Can we export Script to some .vbs or .exe file? Or is there any alternate way through which we can execute scripts?
If you had developed the scripts using Object hierarchy, then you cannot run it without UFT. Scripts having only VBScript commands can be executed as .vbs, but we cannot do activities on Objects then.
But you can run UFT in Remote Desktop by providing it as parameters in 'CreateObject("Quicktest.Application",Remote Ip)'. Other than this, it is not possible to execute a UFT script outside UFT.
You can't execute scripts without UFT installed. That being said, from UFT 12.50 onwards, HP is providing a standalone component called as "Run Time Engine". Here is the snapshot.
The HP Unified Functional Testing (UFT) Runtime Engine is a core component
of UFT which enables you to run various tests (GUI, API and BPT) in functional
testing. In previous UFT versions, this feature was only available with the full
UFT installation. However, beginning with version 12.50, you can use the Runtime Engine as a standalone installation option for your automated testing environment.
Reference
Definately possible.
UFT has introduced a new feature called LeanFT . It just requires installation of LeanFT jars and requires a method to call them
You now can with the UFT Runtime Engine. More information can be found at this link.
From that site:
The UFTRuntime Engine enables you to run UFT tests (both GUI and API)
and business process tests on your computer without installing the
entire UFT IDE. In addition, you can also install the Runtime Engine
without the Run Results Viewer, UFT Add-in for ALM, sample
applications, or Help documentation. This can potentially save you
valuable disk space on your computer
You need UFT 14 v or above to make it use.
UFT 12 doesn't have that this feature

Upon executing a selenium test, spin new Windows VM, execute commands, then exit?

I am running a Mac but need to test Web applications in IE. Ideally, I would love to be able to execute a selenium command on my box, and it would spin up a VM (VirtualBox, VMWare, something like that), run the commands in IE, and then exit the VM once I'm done. Is that possible? If not, does anyone else have a better idea of how to run selenium commands in a Windows environment from a box that is not Windows? My commands are in Python 2.7, if that matters. Thanks
Your requirements shall be possible to fulfill.
Selenium can be using "Selenium Server" and your python code using selenium package shall be able talking to it - it uses http protocol for such a remote control.
Selenium server is using Java, and as it is started, it shows url on which it awaits commands.
These urls can be then used in your python code when constructing driver for your browser, there you specify url of remote Selenim server and shall be able continuing as if you would work locally.
Description how to connect is here.
Feel free to comment or reply to me how it went, it sounds very interesting but I do not have any real experience with that so far.

How to Starting specific RC from selenium grid which is running through Hudson plugin?

My environment:
Hudson -> with selenium grid plugin - Installed on linux machine
Hudson -> Having 4 machines ( 1 linux , 3 Windows ) as node
TestCases -> MyTestCases are in TestNG
In Hudson server I checked the selenium console http://localhost:4444/console. It shows the node machines registered as RC with random port numbers. I run the test (test is configured as another job) . Test is running on any one of the machine / RC.
But I want to execute tests on specific environment Machine 1 / Machine 3 . How can I achieve this? What and how do I have to change the configuration files on selenium-grid on server to do this?
If your machines are providing different environments, simply declare different environments in your grid_configuration.yml file and then have your client request those environments.
There is no out of the box way to do this in Selenium 1.0. Hub can pass the command to any of the registered RCs. There are workarounds
Easy way - Register RC ONLY from the machine you want to use for execution.
A little harder way - In the RC machine that you are trying to execute the script, start the browser with a different name. If you are using *firefox now, change it to FirefoxForWindows or something similar. List of browsers will be there in grid console. Internally both will start tests on firefox browser only. Now you will have 3 RCs supporting *firefox browser and one supporting FirefoxOnWindows browser. Now change the browsername you pass to the test from *firefox to FirefoxOnWindows. Hub will see that only one machine has that configuration and it will pass the commands to that RC alone.
If you are using Selenium-1.0 for your test.The following link will help.
http://selenium-grid.seleniumhq.org/run_the_demo.html
In the link it is mentioned how to give particular name to the RC while registering them to hub.
And using code how to connect to a particular env. in hub

Resources