我们让Jenkins在centOS vm上运行无头,并通过另一台计算机上的http调用访问它。
我有一个运行UI Selenium Tests的项目,除了firefox之外,一切运行良好。它抱怨该配置文件没有在centOS vm上,所以它可以将它转发到Windows VM进行测试。有没有人知道如何在centOS上获得最新最好的firefox,因为yum只有17个(无头CentOS VM)?另外,如果我只想在该VM上scp当前的firefox配置文件,那么firefox配置文件存储在CentOS操作系统中的哪个位置?我还没有想到的任何其他解决方案?如果需要更多信息,请告诉我,jenkins错误如下:
org.openqa.selenium.firefox.UnableToCreateProfileException: Given model profile directory does not exist: C:\Users\Selenium\FirefoxDriver
Build info: version: '2.31.0', revision: '1bd294d', time: '2013-02-27 20:52:59'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '2.6.32-358.6.1.el6.x86_64', java.version: '1.7.0'
Driver info: driver.version: unknown
org.openqa.selenium.firefox.FirefoxProfile.verifyModel(FirefoxProfile.java:154)
org.openqa.selenium.firefox.FirefoxProfile.<init>(FirefoxProfile.java:92)
org.openqa.selenium.firefox.FirefoxProfile.<init>(FirefoxProfile.java:79)
com.igt.sqes.automation.selenium.factories.WebDriverFactory.createWebDriver(Unknown Source)
com.igt.sqes.automation.arcus.setup.ArcusTestSuiteSetup.setUp(Unknown Source)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.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.runSuitesLocally(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。
答案 0 :(得分:2)
<强> 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。尝试复制现有配置文件并明确指定
答案 1 :(得分:0)
使CentOS VM可用的Firefox配置文件在运行Selnium节点的Windows VM上使用的一种方法是在Windows上创建指向Firefox配置文件的共享,然后在CentOS上安装该共享。以下是我用来完成这项工作的步骤:
通过将FirefoxDriver.PROFILE功能设置为指向CentOS安装的共享来配置Selenium Firefox驱动程序。然后在创建时将功能传递给Selenium Webdriver。例如在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);
Firefox配置文件将来自CentOS共享,并在实例化Selenium驱动程序后转发到Windows VM Selenium节点。