我正在尝试在无头chrome的Circle CI中运行测试。我使用的是selenium服务器版本3.8.1和chromedriver版本2.34
protractor_conf.js包括Chrome功能:
var chromeCapabilities = {
browserName: 'chrome',
chromeOptions: {
args: [
'headless','--show-fps-counter=false', '--remote-debugging-port=2222', '--disable-gpu'
]
}
}
我的sh脚本包括以下命令webdriver-Manager,然后运行测试:
./node_modules/protractor/bin/webdriver-manager clean
./node_modules/protractor/bin/webdriver-manager update --gecko false --versions.standalone 3.8.1 --versions.chrome 2.34
./node_modules/protractor/bin/webdriver-manager start &
echo "*** Run script for e2e tests"
gulp e2e
我在mcircle.yml添加了这些来安装最新版本的稳定chrome,并推出了无头听localhost:
dependencies:
post:
# Install the latest Chrome
- curl -L -o google-chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
- sudo dpkg -i google-chrome.deb
- sudo sed -i 's|HERE/chrome\"|HERE/chrome\" --disable-setuid-sandbox|g' /opt/google/chrome/google-chrome
- rm google-chrome.deb
before_install:
- google-chrome --headless --remote-debugging-port=2222 --disable-gpu http://localhost &
所以,当我现在运行构建时,测试根本不运行。日志显示:
** Updating webdriver **
[05:46:11] W/file_manager - path does not exist
/home/ubuntu/pharma/test/node_modules/protractor/node_modules/webdriver-
manager/selenium
[05:46:11] I/file_manager - creating folder
/home/ubuntu/pharma/test/node_modules/protractor/node_modules/webdriver-
manager/selenium
[05:46:12] I/update - chromedriver: unzipping chromedriver_2.34.zip
[05:46:12] I/update - chromedriver: setting permissions to 0755 for
/home/ubuntu/pharma/test/node_modules/protractor/node_modules/webdriver-
manager/selenium/chromedriver_2.34
[05:46:13] I/start - java -Djava.security.egd=file:///dev/./urandom -Dwebdriver.chrome.driver=/home/ubuntu/pharma/test/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.34 -jar /home/ubuntu/pharma/test/node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-3.8.1.jar -port 4444
[05:46:13] I/start - seleniumProcess.pid: 24198
05:46:13.642 INFO - Selenium build info: version: '3.8.1', revision: '6e95a6684b'
05:46:13.643 INFO - Launching a standalone Selenium Server
2018-01-12 05:46:13.740:INFO::main: Logging initialized @385ms to org.seleniumhq.jetty9.util.log.StdErrLog
05:46:13.781 INFO - Using `new FirefoxOptions()` is preferred to `DesiredCapabilities.firefox()`
05:46:13.799 INFO - Using `new ChromeOptions()` is preferred to `DesiredCapabilities.chrome()`
05:46:13.801 INFO - Using `new EdgeOptions()` is preferred to `DesiredCapabilities.edge()`
05:46:13.803 INFO - Driver class not found: com.opera.core.systems.OperaDriver
05:46:13.803 INFO - Using `new OperaOptions()` is preferred to `DesiredCapabilities.operaBlink()`
05:46:13.803 INFO - Using `new SafariOptions()` is preferred to `DesiredCapabilities.safari()`
05:46:13.804 INFO - Driver class not found: org.openqa.selenium.phantomjs.PhantomJSDriver
05:46:13.845 INFO - Driver provider class org.openqa.selenium.ie.InternetExplorerDriver registration is skipped:
registration capabilities Capabilities {browserName: internet explorer, ensureCleanSession: true, platform: WINDOWS, version: } does not match the current platform LINUX
05:46:13.845 INFO - Driver provider class org.openqa.selenium.edge.EdgeDriver registration is skipped:
registration capabilities Capabilities {browserName: MicrosoftEdge, platform: WINDOWS, version: } does not match the current platform LINUX
05:46:13.846 INFO - Driver provider class org.openqa.selenium.safari.SafariDriver registration is skipped:
registration capabilities Capabilities {browserName: safari, platform: MAC, version: } does not match the current platform LINUX
05:46:13.891 INFO - Using `new ChromeOptions()` is preferred to `DesiredCapabilities.chrome()`
05:46:13.892 INFO - Using `new EdgeOptions()` is preferred to `DesiredCapabilities.edge()`
05:46:13.892 INFO - Using `new FirefoxOptions()` is preferred to `DesiredCapabilities.firefox()`
05:46:13.893 INFO - Using `new OperaOptions()` is preferred to `DesiredCapabilities.operaBlink()`
05:46:13.893 INFO - Using `new SafariOptions()` is preferred to `DesiredCapabilities.safari()`
05:46:13.902 INFO - Using the passthrough mode handler
2018-01-12 05:46:13.932:INFO:osjs.Server:main: jetty-9.4.7.v20170914
2018-01-12 05:46:13.970:WARN:osjs.SecurityHandler:main: ServletContext@o.s.j.s.ServletContextHandler@2db7a79b{/,null,STARTING} has uncovered http methods for path: /
2018-01-12 05:46:13.978:INFO:osjsh.ContextHandler:main: Started o.s.j.s.ServletContextHandler@2db7a79b{/,null,AVAILABLE}
2018-01-12 05:46:13.998:INFO:osjs.AbstractConnector:main: Started ServerConnector@67b467e9{HTTP/1.1,[http/1.1]}{0.0.0.0:4444}
2018-01-12 05:46:13.999:INFO:osjs.Server:main: Started @644ms
05:46:13.999 INFO - Selenium Server is up and running
[07:02:53] Using gulpfile ~/pharma/test/gulpfile.babel.js
[07:02:53] Starting 'set-envVars'...
[07:02:53] Finished 'set-envVars' after 245 μs
[07:02:53] Starting 'set-directories'...
[07:02:53] Finished 'set-directories' after 428 μs
[07:02:53] Starting 'e2e'...
--> Running tests using command: ./node_modules/.bin/protractor ./protractor_e2e_conf.js
Logger: Output file - /home/ubuntu/pharma/test/output/e2e/logs/console.log
[07:02:54] [INFO] Report destination: /home/ubuntu/pharma/test/output/e2e/logs/e2eTests.html
[07:02:54] [INFO] [07:02:54] I/launcher - Running 1 instances of WebDriver
[07:02:55] [INFO] [07:02:55] I/testLogger -
------------------------------------
[07:02:55] [INFO] [07:02:55] I/testLogger - [Chrome] PID: 24232
[Chrome] Specs: /home/ubuntu/pharma/test/e2e/spec/targeting/data_upload/uploadAccount_spec.js
[Chrome]
[Chrome] Logger: Output file - /home/ubuntu/pharma/test/output/e2e/logs/console.log
[Chrome] [07:02:55] [INFO] [07:02:55] I/local - Starting selenium standalone server...
[Chrome] events.js:160
[Chrome] throw er; // Unhandled 'error' event
[Chrome] ^
[Chrome]
[Chrome] Error: spawn /usr/lib64/jvm/java-1.8.0-openjdk-1.8.0/bin/java ENOENT
[Chrome] at exports._errnoException (util.js:1018:11)
[Chrome] at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
[Chrome] at onErrorNT (internal/child_process.js:367:16)
[Chrome] at _combinedTickCallback (internal/process/next_tick.js:80:11)
[Chrome] at process._tickCallback (internal/process/next_tick.js:104:9)
使用的版本:
我错过了什么?任何帮助都将不胜感激。
解决方案:
circle ci上安装的默认java版本为1.7。我强迫它安装1.8 jdk:
我在Ubuntu16.04下遇到了Neo4J服务器的问题。我想安装Neo4J的2.3.3版本。现在当我试图启动服务器时,我得到了这个错误: ~sudo/var/lib/neo4j/bin/neo4j start
我试图用Java(在Fedora 27上)创建一个测试JSON验证器,但是我不能导入与JSON相关的包。不同的Java实现是否为此使用不同的包? 我的源代码如下: 错误日志: jsonParsing.java:2:错误:包javax.json不存在,导入javax.json.json;^jsonParsing.java:3:错误:包javax.json不存在,导入javax.json.jsonOb
应用程序在启动时抛出错误,专门查找java-1.8.0-openjdk-amd64。环境是Ubuntu1604。Java java-8-openjdk-i386已经安装,但是需要amd64,然后使用它作为备用。我在哪里可以源码amd64 tar文件?已经运行了“sudo apt-get install openjdk-8-jdk”。THX 2/6/21当前状态-无法安装Java 8 AMD64。
Grails 2.4.3是否需要Java 1.8.0? 这里找到的Grails doc说的是java 1.6.0及以上版本,但我使用java 1.7.0_21新创建的Grails应用程序面临问题。 谢谢!
我得到的错误就像 改造。错误:com。谷歌。格森。JsonSyntaxException:com。谷歌。格森。流动格式错误的JSONException:使用JsonReader。setLenient(true)在第1行第7列路径接受格式错误的JSON$ 我尝试了一个关于改型API的异常的答案?1.我正在使用改装版1.8,我该怎么办? 我的Java代码: 反转录助手 JSON响应 其他代码
问题内容: 我将SQL Server 2014更新为最新的修订包( 12.0.5207 )。在环境中,唯一启用的协议是TLS1.2(已为此目的设置了注册表项)。我可以使用Management Studio在本地和远程使用SA帐户连接到SQL Server。 但是,当我尝试使用Java代码和JDBC驱动程序 sqljdbc42.jar 建立与SQL Server的连接时,会引发以下异常: 驱动程序无