centOS, Jenkins, Firefox & Selenium GRID -- UnableToCreateProfileException centOS, Jenkins, Firefox & Selenium GRID -- UnableToCreateProfileException jenkins jenkins

centOS, Jenkins, Firefox & Selenium GRID -- UnableToCreateProfileException


1. Try to install newer version of Firefox

In order to do that you can use Remi repository

## Remi Dependency on CentOS 6 and Red Hat (RHEL) 6 ##rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm## CentOS 6 and Red Hat (RHEL) 6 ##rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

Step by step instruction

2. Try to copy existing profile and specify it explicitly

Please see the following thread: CentOS Selenium - Preparing firefox profile


One way make a Firefox profile available to CentOS VM for use on a Windows VM running a Selnium node is to create a share on Windows pointing to a Firefox profile and then mounting that share on CentOS. Here are the steps I used to make this work:

  1. On Windows, create a share of the directory the Firefox profile is in. The default Firefox profile is typically located in something like C:\Users\username\AppData\Local\Mozilla\Firefox\Profiles\427nha20.default. You may want to put the profile in a permissions-limited directory, such as one with read only privileges.
  2. On CentOS, create a directory in the /mnt directory with the name you gave the Windows share. The names don't have to be the same but it helps to keep things consistent.
  3. On CentOS, add the following line to the /etc/fstab file: //windowsVMIP/windowsShareName /mnt/windowsShareName cifs username=windowsUser,password=windowsPassword,uid=123,gid=123,_netdev,ro 0 0
  4. windowsVMIP is the IP of the VM with the share; windowsShareName is the name of the Windows share; /mnt/windowsShareName is the name you gave the Windows share; username and password are the credentials for the Windows user; uid is the user ID on CentOS; gid is the primary group ID on CentOS (you can get the uid and gid by executing grep jenkins /etc/passwd. They are the 3rd and 4th attributes respectively);
  5. In CentOS, mount the Windows share manually by executing the following: mount -t cifs -o username=windowsUser,password=windowsPassword,uid=123,gid=123 //windowsVMIP/windowsShareName /mnt/windowsShareName
  6. cd to /mnt/windowsShare and ls to make sure the mount succeeded
  7. Configure the Selenium Firefox driver by setting the FirefoxDriver.PROFILE capability to point to the CentOS mounted share. Then pass the capabilities to the Selenium Webdriver when creating it. For example in Java:

    FirefoxProfile profile = new FirefoxProfile(new File("/mnt/windowsShareName"));DesiredCapabilities capabilities = DesiredCapabilities.firefox();capabilities.setCapability(FirefoxDriver.PROFILE, profile);
    WebDriver driver = new RemoteWebDriver(new URL(gridHubURL), capabilities);

  8. The Firefox profile will be sourced from the CentOS share and forwarded to the Windows VM Selenium node after the Selenium driver is instantiated.