Do we need to have the Browser installed on GUI less RedHat Linux m/c when we are running headless tests using XVFB? - serenity-bdd

Since we are facing problems with running headless Serenity tests using the installed Firefox browser on a Jenkins Server running on RedHat Linux machine, we installed XVFB to run the tests.
Our preferred browser to test is with Chrome, not Firefox. But Chrome is not available for RedHat Linux (Jenkins) Server.
Question, is do we need to have the Chrome browser installed on the Linux machine in order to run headless tests using XVFB ?

Yes, you need to have both the chrome browser and chrome driver to run tests. You can find the chrome driver [here][http://chromedriver.chromium.org/downloads]. If Chrome is not available for Red Hat Edition, you can install open source chromium.

Related

Selenium Webdriver testing(Safari ) in windows or ubuntu

I working on the automation script using selenium webdriver, I tried with the browsers chrome and firefox in my windows and linux machine both chrome and firefox works fine, but I tried the same with safari but it is not working in both windows and linux machine, Wanna know is there a possibility to launch safari webdriver for testing in windows and linux machine. Thanks in advance.

Can we install safari and edge webDriver on the docker?

I could install chrome and firefox webDriver on Docker, but I don't know if it is possible to do the same with safari and edge too.
So any one has an idea? if yes how to do?
Docker containerisation is limited to Linux OS containers only. This means no OS X nor Windows. So you can't run Safari nor Edge.
But you can add a vagrant vm browser (running Windows or OS X), and then connect them to your Selenium hub.
There is no installation available for safari on docker. You can read the following issue for more details
https://github.com/aerokube/selenoid/issues/663

In Selenium how does ChromeDriver executable finds Chrome browser?

For Selenium, we define the chrome executable path in System.setProperty. When a URL is passed in driver.get and Chrome invokes:
1 - How does chrome executable know where Chrome browser is actually installed?
2 - What would happen if I do not have Chrome browser?
Responses appreciated!!
As per the Requirements of ChromeDriver:
The ChromeDriver consists of three separate pieces. There is the browser itself i.e. chrome, the language bindings provided by the Selenium project i.e. the driver and an executable downloaded from the Chromium project which acts as a bridge between chrome and the driver. This executable is called the chromedriver, we generally refer to it as the server to reduce confusion.
The server expects you to have Chrome installed in the default location for each system as per the image below:
1For Linux systems, the ChromeDriver expects /usr/bin/google-chrome to be a symlink to the actual Chrome binary. In case you are using a Chrome executable in a non-standard location you have to override the Chrome binary location. as follows:
Google chrome doesn't have built-in driver server, so you need to install ChromeDriver so that the selenium code communicates with the chrome browser.This ChromeDriver implements webdriver's wire protocol (client being system on which webdriver API is used & server being browser acting as/containing stand alone server).
For Internet explorer one needs to install InternetExplorerDriver as stand alone server. For Selenium 3.0 & above to work with firefox, Geckodrver has to be installed.

Browser is not launching even test is running through Jenkins on ubuntu

I am trying to launch browser for automation testing(selenium) using jenkins on ubuntu OS. Test are running properly but browser is not launching seems like it is running headlessly.
I am able to fix this using this solution -
Added Xvfb plugin and added DISPLAY variable.
Running jenkins.war
from console using java -jar jenkins.war
As I know in Windows OS by checking "Allow service to interact with desktop" while jenkins installation we can fix this. So Is there any way we can do this on ubuntu by updating some configuration so we don't have run jenkins.war from console everytime.
There are two ways to facilitate the launch of browser on ubuntu OS.
1.First way - Configure your Jenkins nodes and add the ubuntu machine. Add the sshing details(username-password OR RSA key) of the target machine. This configuration is recommended if you are in cloud.
2.Second way(not recommended on cloud environments) -You have to run a Selenium standalone-Server (a standalone node), and register your remote WebDriver to it.
WebDriver driver = new RemoteWebDriver(new URL("http://ipOfUbuntuMachine:port/wd/hub"), capability);

[Vagrant][Jenkins][Behat][Selenium] How to combine them?

I have a project with some requirements: install jenkins, selenium, behat on a Vagrant box with ubuntu 12.04. I installed jenkins, selenium, behat on this box. When i run selenium, jenkins and run some behat test, the error display :
- Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
Error: no display specified
Error: no display specified
I installed firefox and use selenium-server-standalone-2.35.0.
firefox -v
Mozilla Firefox 24.0
What should i do?
Thanks
Its most likely that your Jenkins user does not have an X session to run firefox in.
You can use something like Xvfb which is a virtual frame buffer How do I run Selenium in Xvfb?
Alternatively you could use phantomjs/ghostdriver which is a totally headless webdriver for selenium https://github.com/detro/ghostdriver - so you don't need any X at all.
I personally run a selenium hub and connect various drivers to it for different browsers. These drivers can be on different machines and platforms so you can fully test different configurations