centOS、Jenkins、Firefox和;Selenium网格--无法创建ProfileException

centOS、Jenkins、Firefox和;Selenium网格--无法创建ProfileException,firefox,selenium,jenkins,centos,selenium-webdriver,Firefox,Selenium,Jenkins,Centos,Selenium Webdriver,我们让Jenkins在centOS虚拟机上运行headless,并通过另一台计算机上的http调用访问它 我有一个运行UI Selenium测试的项目,除了firefox测试外,所有测试都运行良好。它抱怨配置文件不在centOS虚拟机上,因此可以将其转发到windows虚拟机进行测试。有人知道如何在centOS上获得最新和最好的firefox吗?因为百胜只有17个firefox(headless centOS虚拟机)?另外,如果我只想在CentOS操作系统上scp当前的firefox配置文件,那

我们让Jenkins在centOS虚拟机上运行headless,并通过另一台计算机上的http调用访问它

我有一个运行UI Selenium测试的项目,除了firefox测试外,所有测试都运行良好。它抱怨配置文件不在centOS虚拟机上,因此可以将其转发到windows虚拟机进行测试。有人知道如何在centOS上获得最新和最好的firefox吗?因为百胜只有17个firefox(headless centOS虚拟机)?另外,如果我只想在CentOS操作系统上scp当前的firefox配置文件,那么firefox配置文件存储在哪里?我没有想到任何其他解决方案?如果需要更多信息,请告诉我,jenkins错误如下:

org.openqa.selenium.firefox.UnableToCreateProfileException:给定的模型配置文件目录不存在:C:\Users\selenium\FirefoxDriver
构建信息:版本:“2.31.0”,修订版:“1bd294d”,时间:“2013-02-27 20:52:59”
系统信息:os.name:'Linux',os.arch:'amd64',os.version:'2.6.32-358.6.1.el6.x86_64',java.version:'1.7.0'
驱动程序信息:驱动程序。版本:未知
org.openqa.selenium.firefox.FirefoxProfile.verifyModel(FirefoxProfile.java:154)
org.openqa.selenium.firefox.FirefoxProfile.(FirefoxProfile.java:92)
org.openqa.selenium.firefox.FirefoxProfile.(FirefoxProfile.java:79)
com.igt.sqes.automation.selenium.factories.WebDriverFactory.createWebDriver(未知源)
com.igt.sqes.automation.arcus.setup.ArcusTestSuiteSetup.setup(未知源)
sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)
invoke(NativeMethodAccessorImpl.java:57)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:601)
org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:564)
org.testng.internal.Invoker.invokeConfigurations(Invoker.java:213)
org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138)
org.testng.SuiteRunner.privateRun(SuiteRunner.java:277)
org.testng.SuiteRunner.run(SuiteRunner.java:240)
org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
org.testng.testng.runSuitesSequentially(testng.java:1198)
org.testng.testng.runSuitesSequentially(testng.java:1194)
org.testng.testng.runSuitesLocal(testng.java:1123)
org.testng.testng.run(testng.java:1031)
org.testng.testng.privateMain(testng.java:1338)
org.testng.testng.main(testng.java:1307)


从windows机箱运行时,它工作正常,因为驱动程序位于该位置,可以转发到测试vm。

1。尝试安装新版本的Firefox

为了做到这一点,您可以使用Remi存储库

## 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

2。尝试复制现有配置文件并明确指定它


请参阅以下线程:

让CentOS VM可以在运行Selnium节点的Windows VM上使用Firefox配置文件的一种方法是在Windows上创建指向Firefox配置文件的共享,然后在CentOS上装载该共享。以下是我用来实现这一目标的步骤:

  • 在Windows上,创建Firefox配置文件所在目录的共享。默认的Firefox配置文件通常位于C:\Users\username\AppData\Local\Mozilla\Firefox\Profiles\427nha20.default中。您可能希望将配置文件放在权限有限的目录中,例如具有只读权限的目录
  • 在CentOS上,在/mnt目录中创建一个名为Windows共享的目录。名称不必相同,但有助于保持一致
  • 在CentOS上,将以下行添加到/etc/fstab文件中: //windowsVMIP/windowsShareName/mnt/windowsShareName cifs用户名=windowsUser,密码=windowsPassword,uid=123,gid=123,_netdev,ro 0
  • windowsVMIP是具有共享的VM的IP;windowsShareName是Windows共享的名称/mnt/windowsShareName是您为Windows共享提供的名称;用户名和密码是Windows用户的凭据;uid是CentOS上的用户ID;gid是CentOS上的主要组ID(您可以通过执行grep jenkins/etc/passwd来获取uid和gid,它们分别是第3和第4个属性)
  • 在CentOS中,通过执行以下操作手动装载Windows共享:mount-t cifs-o username=windowsUser,password=windowsPassword,uid=123,gid=123//windowsVMIP/windowsShareName/mnt/windowsShareName
  • cd到/mnt/windowsShare和ls,以确保装载成功
  • 通过将FirefoxDriver.PROFILE功能设置为指向CentOS安装的共享,配置Selenium Firefox驱动程序。然后在创建Selenium Webdriver时将这些功能传递给它。例如,在Java中:

    FirefoxProfile profile=newfirefoxprofile(新文件(“/mnt/windowsShareName”);
    DesiredCapabilities=DesiredCapabilities.firefox();
    能力。设置能力(FirefoxDriver.PROFILE,PROFILE)
    WebDriver driver=新的RemoteWebDriver(新的URL(gridHubURL),功能)

  • Firefox配置文件将源于CentOS共享,并在Selenium驱动程序实例化后转发到Windows VM Selenium节点


  • 我会尽快看的!