6 firefox selenium centos jenkins selenium-webdriver
我们让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框运行时它工作正常导致驱动程序在该位置,并可以转发测试虚拟机.
使 Firefox 配置文件可供 CentOS VM 在运行 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 节点。
| 归档时间: |
|
| 查看次数: |
1769 次 |
| 最近记录: |