Jenkins job throws error when running protractor - jenkins

Get the following error when protractor is about to run on a windows host via jenkins job. We run selenium hub on a linux host with the selenium node running off of windows
^
`Error: ECONNREFUSED connect ECONNREFUSED
at ClientRequest.<anonymous> (C:\dependencies-dashboard\node_modules\selenium-webdriver\http\index.js:172:16)
at ClientRequest.emit (events.js:107:17)
at Socket.socketErrorListener (_http_client.js:271:9)
at Socket.emit (events.js:107:17)
at net.js:459:14
at process._tickCallback (node.js:355:11)
From: Task: WebDriver.createSession()
at Function.webdriver.WebDriver.acquireSession_ (C:\dependencies-dashboard\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:157:22)
at Function.webdriver.WebDriver.createSession (C:\dependencies-dashboard\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:131:30)
at new Driver (C:\dependencies-dashboard\node_modules\selenium-webdriver\chrome.js:810:36)
at [object Object].DirectDriverProvider.getNewDriver (C:\dependencies-dashboard\node_modules\protractor\lib\driverProviders\direct.js:68:16)
at [object Object].Runner.createBrowser (C:\dependencies-dashboard\node_modules\protractor\lib\runner.js:182:37)
at C:\dependencies-dashboard\node_modules\protractor\lib\runner.js:263:21
at _fulfilled (C:\dependencies-dashboard\node_modules\protractor\node_modules\q\q.js:797:54)
at self.promiseDispatch.done (C:\dependencies-dashboard\node_modules\protractor\node_modules\q\q.js:826:30)
at Promise.promise.promiseDispatch (C:\dependencies-dashboard\node_modules\protractor\node_modules\q\q.js:759:13)
at C:\dependencies-dashboard\node_modules\protractor\node_modules\q\q.js:525:49
[launcher] Process exited with error code 1
events.js:85
throw er; // Unhandled 'error' event
^
Error: protractor exited with code 1
Build step 'Execute Windows batch command' marked build as failure
Finished: FAILURE`

Related

Cypress failed to make a connection to the Edge/Firefox in Jenkins

I created some VueJS test and run with Cypress.
Everything is OK until I run it on Jenkins (with a GitHub hook trigger for GITScm polling)
Only cypress run --browser chrome and cypress run --browser electron work.
With Edge and Firefox, it returned this kind of error
Still waiting to connect to Edge, retrying in 1 second (attempt 62/62)
Cypress failed to make a connection to the Chrome DevTools Protocol after retrying for 50 seconds.
This usually indicates there was a problem opening the Edge browser.
The CDP port requested was 63444.
Error: connect ECONNREFUSED 127.0.0.1:63444
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1157:16)
Error: Command failed with exit code 1: npm run cypress:run
at makeError (C:\ProgramData\Jenkins\.jenkins\workspace\Homepage\node_modules\start-server-and-test\node_modules\execa\lib\error.js:60:11)
at handlePromise (C:\ProgramData\Jenkins\.jenkins\workspace\Homepage\node_modules\start-server-and-test\node_modules\execa\index.js:118:26)
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
shortMessage: 'Command failed with exit code 1: npm run cypress:run',
command: 'npm run cypress:run',
escapedCommand: '"npm run cypress:run"',
exitCode: 1,
signal: undefined,
signalDescription: undefined,
stdout: undefined,
stderr: undefined,
failed: true,
timedOut: false,
isCanceled: false,
killed: false
}
How can I run it normally in Jenkins? Thanks in advance.

node tools/downloadWebRTC.js command fails when installing "react-native-webrtc" package

I am trying to install the package "react-native-webrtc" but getting this error (yarn install react-native-webrtc --verbose):
react-native-webrtc
verbose 189.970120017 Error: /Users/samwin/dev/MobileAgent/node_modules/react-native-webrtc: Command failed.
Exit code: 1
Command: node tools/downloadWebRTC.js
Arguments:
Directory: /Users/samwin/dev/MobileAgent/node_modules/react-native-webrtc
Output:
Downloading https://github.com/jitsi/webrtc/releases/download/v100.0.0/WebRTC.xcframework.tgz...
node:internal/process/promises:246
triggerUncaughtException(err, true /* fromPromise */);
^
Error: connect ECONNREFUSED 185.199.108.133:443
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1161:16) {
errno: -61,
code: 'ECONNREFUSED',
syscall: 'connect',
address: '185.199.108.133',
port: 443
}
at ProcessTermError.ExtendableBuiltin (/usr/local/Cellar/yarn/1.22.4/libexec/lib/cli.js:721:66)
at ProcessTermError.MessageError (/usr/local/Cellar/yarn/1.22.4/libexec/lib/cli.js:750:123)
at new ProcessTermError (/usr/local/Cellar/yarn/1.22.4/libexec/lib/cli.js:790:113)
at ChildProcess.<anonymous> (/usr/local/Cellar/yarn/1.22.4/libexec/lib/cli.js:25884:17)
at ChildProcess.emit (node:events:390:28)
at maybeClose (node:internal/child_process:1064:16)
at Socket.<anonymous> (node:internal/child_process:450:11)
at Socket.emit (node:events:390:28)
at Pipe.<anonymous> (node:net:687:12)
error /Users/samwin/dev/MobileAgent/node_modules/react-native-webrtc: Command failed.
Exit code: 1
Command: node tools/downloadWebRTC.js
Arguments:
Directory: /Users/samwin/dev/MobileAgent/node_modules/react-native-webrtc
Output:
Downloading https://github.com/jitsi/webrtc/releases/download/v100.0.0/WebRTC.xcframework.tgz...
node:internal/process/promises:246
triggerUncaughtException(err, true /* fromPromise */);
^
Error: connect ECONNREFUSED 185.199.108.133:443
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1161:16) {
errno: -61,
code: 'ECONNREFUSED',
syscall: 'connect',
The folder react-native-webrtc exists in node_modules, but when I try to build the app in Xcode, then it throws error like described here.
BTW: I can download the file when opening the url in the browser.
Is there any solution for this issue?
My solution was to download the .tgz file manually (which should be done actually in tools/downloadWebRTC.js) and extracted it to corresponding location. Now the Xcode build works fine.

Getting prepare Hook error while trying to run test cases using appium

2022-06-20T10:22:26.412Z INFO #wdio/cli:launcher: Run onPrepare hook
2022-06-20T10:23:22.099Z ERROR #wdio/cli:utils: A service failed in the 'onPrepare' hook
Error: Appium exited before timeout (exit code: 1)
at ChildProcess.<anonymous> (C:\Users\Joyi\Downloads\webdriverio-appium-course-master\webdriverio-appium-course-master\node_modules\#wdio\appium-service\build\launcher.js:110:22)
at Object.onceWrapper (node:events:642:26)
at ChildProcess.emit (node:events:527:28)
at ChildProcess.emit (node:domain:475:12)
at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)

Selenium job configuration error in Jenkins

I am just integrating Protractor end to end test job in my Jenkins. Jenkins is running on CentOS 7. With the help of one of my test engineer created a config.js file and created a Jenkins job for the same.
I am getting the following error in Jenkins console while executing this job:
+ cd '/var/lib/jenkins/workspace/UI Automation Test/UI-automation-tests/Test/steps'
+ protractor config.js
(node:11138) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
[07:12:43] I/launcher - Running 1 instances of WebDriver
[07:12:43] I/hosted - Using the selenium server at http://localhost:4444/wd/hub
[07:12:43] W/launcher - Ignoring uncaught error WebDriverError: unknown error: Chrome failed to start: exited abnormally
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
(Driver info: chromedriver=2.44.609551 (5d576e9a44fe4c5b6a07e568f1ebc753f1214634),platform=Linux 3.10.0-862.2.3.el7.x86_64 x86_64) (WARNING: The server did not provide any stacktrace information)
It is a bug of ChromeDriver (already reported). For Linux systems you can use this argument to avoid this error:
--disable-dev-shm-usage

Failed to execute fabric8 docker plugin

Running mvn clean install pulls up this error( Windows)
[ERROR] Failed to execute goal io.fabric8:docker-maven-plugin:0.20.1:start (prepare-environment) on project integration-test: Execution prepare-environment of goal io.fabric8:docker-maven-plugin:0.20.1:start failed: Start-Job failed with unexpected exception: [sebp/elk:latest] "elk": Timeout after 120365 ms while waiting on url http://localhost:32774/

Resources