- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
所以我正在使用java和maven学习selenium和jenkins集成。我在使用 chrome 和 jenkins 时遇到了问题,并被告知我应该尝试 firefox webdriver。这就是我所做的。但是,当我在 Jenkins 上运行构建时出现以下错误:谁能帮我这个?我的脚本在 IDE 本地运行良好。
我还使用 Mac 10.13.6 (High Sierra),火狐70,壁虎驱动程序 v 0.26.0 ,3.141.59,Java Eclipse ID 和Maven 3.6.2
请帮忙,谢谢!
Started by user Eamo
Running as SYSTEM
Building in workspace /Users/Shared/Jenkins/Home/workspace/test
Parsing POMs
Established TCP socket on 59937
[Test] $ /Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/bin/java -cp /Users/Shared/Jenkins/Home/plugins/maven-plugin/WEB-INF/lib/maven35-agent-1.13.jar:/Applications/apache-maven-3.6.2/boot/plexus-classworlds-2.6.0.jar:/Applications/apache-maven-3.6.2/conf/logging jenkins.maven3.agent.Maven35Main /Applications/apache-maven-3.6.2 /Users/Shared/Jenkins/Home/war/WEB-INF/lib/remoting-3.36.jar /Users/Shared/Jenkins/Home/plugins/maven-plugin/WEB-INF/lib/maven35-interceptor-1.13.jar /Users/Shared/Jenkins/Home/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.13.jar 59937
<===[JENKINS REMOTING CAPACITY]===>channel started
Executing Maven: -B -f /Users/Eamon/eclipse-workspace/Test/pom.xml clean test
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------------< SeleniumTest:SeleniumTest >----------------------
[INFO] Building SeleniumTest 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ SeleniumTest ---
[INFO] Deleting /Users/Eamon/eclipse-workspace/Test/target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ SeleniumTest ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ SeleniumTest ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ SeleniumTest ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ SeleniumTest ---
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 1 source file to /Users/Eamon/eclipse-workspace/Test/target/test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.12:test (default-test) @ SeleniumTest ---
[INFO] Surefire report directory: /Users/Eamon/eclipse-workspace/Test/target/surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running TestSuite
1575090370363 mozrunner::runner INFO Running command: "/Applications/Firefox.app/Contents/MacOS/firefox-bin" "-marionette" "-foreground" "-no-remote" "-profile" "/var/folders/3n/x7zhpjbj00z7bm533_6x264r00008b/T/rust_mozprofileNeahYN"
_RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.
1575090375044 addons.webextension.screenshots@mozilla.org WARN Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: mozillaAddons
1575090375044 addons.webextension.screenshots@mozilla.org WARN Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: telemetry
1575090375044 addons.webextension.screenshots@mozilla.org WARN Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: resource://pdf.js/
1575090375045 addons.webextension.screenshots@mozilla.org WARN Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: about:reader*
_RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.
_RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.
_RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Tests run: 3, Failures: 1, Errors: 0, Skipped: 2, Time elapsed: 62.465 sec <<< FAILURE!
Results :
Failed tests: startBrowser(Eamon.EamonTest): connection refused(..)
Tests run: 3, Failures: 1, Errors: 0, Skipped: 2
[ERROR] There are test failures.
Please refer to /Users/Eamon/eclipse-workspace/Test/target/surefire-reports for the individual test results.
[JENKINS] Recording test results
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:16 min
[INFO] Finished at: 2019-11-29T21:07:17-08:00
[INFO] ------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data
[JENKINS] Archiving /Users/Eamon/eclipse-workspace/Test/pom.xml to SeleniumTest/SeleniumTest/0.0.1-SNAPSHOT/SeleniumTest-0.0.1-SNAPSHOT.pom
/Users/Eamon/eclipse-workspace/Test/pom.xml is not inside /Users/Shared/Jenkins/Home/workspace/Test/Users/Eamon/eclipse-workspace/Test/; will archive in a separate pass
channel stopped
Finished: UNSTABLE
public class EamonTest {
public String baseUrl = "http://demo.guru99.com/test/newtours/";
String driverPath = "/Users/Eamon/Desktop/geckodriver";
public WebDriver driver;
@BeforeTest
public void startBrowser() {
System.setProperty("webdriver.gecko.driver", driverPath);
DesiredCapabilities capabilities = DesiredCapabilities.firefox();
capabilities.setCapability("marionette", true);
driver = new FirefoxDriver(capabilities);
}
@Test
public void navigateToUrl() {
driver.get("http://demo.guru99.com/selenium/guru99home/");
}
@AfterTest
public void endTest() {
driver.quit();
}
最佳答案
此错误消息...
1575090370363 mozrunner::runner INFO Running command: "/Applications/Firefox.app/Contents/MacOS/firefox-bin" "-marionette" "-foreground" "-no-remote" "-profile" "/var/folders/3n/x7zhpjbj00z7bm533_6x264r00008b/T/rust_mozprofileNeahYN"
_RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.
1575090375044 addons.webextension.screenshots@mozilla.org WARN Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: mozillaAddons
1575090375044 addons.webextension.screenshots@mozilla.org WARN Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: telemetry
1575090375044 addons.webextension.screenshots@mozilla.org WARN Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: resource://pdf.js/
1575090375045 addons.webextension.screenshots@mozilla.org WARN Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: about:reader*
_RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.
_RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.
_RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
...暗示 GeckoDriver 无法启动/生成新的浏览上下文,即 Firefox 浏览器 session 。
您的主要问题是使用 FirefoxDriver 的已弃用构造函数 类如下:
在当前版本的 Selenium v3.141.59 中,构造函数 FirefoxDriver(CapabilitydesiredCapability)
已被弃用。
您需要使用merge()
方法来自 MutableCapabilities Class,将DesiredCapability类型对象合并到FirefoxOptions类型对象中,并启动WebDriver和WebClient em> 实例通过传递 FirefoxOptions 对象如下:
@BeforeTest
public void startBrowser() {
System.setProperty("webdriver.gecko.driver", driverPath);
DesiredCapabilities capabilities = DesiredCapabilities.firefox();
capabilities.setCapability("marionette", true);
FirefoxOptions options = new FirefoxOptions();
options.merge(capabilities);
driver = new FirefoxDriver(options);
<小时/>
您可以在以下位置找到一些相关讨论:
关于java - 在 Jenkins 中使用 GeckoDriver Firefox 通过 Selenium Maven 建立与 WindowServer 的默认连接错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59113424/
我需要制作一个功能非常简单的 kext。每当按下组合键时,kext 应该终止恰好是“WindowServer”的进程 由于问题的性质,它必须是 kext。它必须独立于系统的用户界面,所以如果它挂断了,
我需要创建非不透明的透明窗口,其中包含不透明的 subview (称为surfaceView)。每个 subview 可以包含数千个 subview (称为controlView)。所以结构一定是这样
我正在尝试注册 CGScreenRefreshCallback 和 CGScreenUpdateMoveCallback(这是苹果对 http://developer.apple.com/mac/li
我有一个有趣的案例给您。并且需要帮助。 我的 Mac 应用程序有一个图层托管的 NSView,里面有很多图层、子图层和子子图层。想象一个带有项目(图标、文本标签)的 Finder 窗口......类似
我正在 Mac 上开发一个 UI 应用程序。运行大约 1 小时后,应用程序似乎卡住了。同时,WindowServer 进程占用的 CPU 非常高,在 50%~100% 之间。 我google了很多,似
我一直在尝试 PyObjC,但似乎无法让 QTKit 导入工作。如果我像这样导入 QTKit: from QTKit import * 我会收到大量错误: [Session started at 20
如有错误请指正。我的理解是 Mac OS X 有一个 WindowServer 进程,它从所有应用程序合成窗口,并在屏幕上绘制最终的合成图像。那么问题是 WindowServer 进程从哪里获得其他应
所以我正在使用java和maven学习selenium和jenkins集成。我在使用 chrome 和 jenkins 时遇到了问题,并被告知我应该尝试 firefox webdriver。这就是我所
我是一名优秀的程序员,十分优秀!