I am trying to run automated tests in Jenkins. The tests had been running well for a long time. But now, when selenium server starts the tests, Jenkins stalls and outputs the following error messages:
[09:18:55] E/launcher - Unable to parse new session response:
[09:18:55] E/launcher - WebDriverError: Unable to parse new session
response:
at doSend.then.response..."
The tests run successfully when I run them manually at the command prompt using the same commands. I am not sure what could be the problem. Any help would be appreciated.
Solution 1:
You may be using old version of chrome with a newer Selenium WebDriver version. You may want to update your chrome to the latest version.
Solution 2:
Multiple versions of Chrome may have been installed. Purge and install a stable package. Do something like:
sudo apt-get purge chrome
sudo apt-get install chrome-stable
Solution 3:
Reinstall your JDK. This is a sure fire way to revive sleeping Jenkins.
Related
I need to integrate my protractor scripts on Jenkins . My code is in Bit bucket and i configured the details on my project in Jenkins.
My Jenkins server is on Linux so i have used Execute shell .
Below are the steps i mentioned in execute shell in order to run.
npm install
webdriver-manager update
webdriver-manager start
protractor conf.js
Initialising WebDriverServlet
20:23:34.444 INFO [SeleniumServer.boot] - Selenium Server is up and running on port 4444
Selenium server is up and running but it got stuck there and unable to execute next step.
.................................
I have also tried executing
npm install
protractor conf.js
by commenting selenium address on conf.js
For which m getting the below error
I/launcher - Running 1 instances of WebDriver
[20:02:30] I/local - Starting selenium standalone server...
[20:02:32] I/local - Selenium standalone server started at .........
Unable to create new service: ChromeDriverService
I need help on how to run the scripts on jenkins. Any help will be appreciated. Thanks in adavnce
I can tell what your problem is, but nor ready to provide a solution
so when you run webdriver-manager start it starts a process. When that process is running, you can't run another one, until you exit this one. When you do it manually, you're using 2 terminal windows, right?
so theoretical solution - you need to look up how to run commands in parallel on linux and this page has many https://www.slashroot.in/how-run-multiple-commands-parallel-linux
Another option that I'm using is to set directConnect: true in config file. This way you don't even need to start a server, protractor will do it for you. And honestly I don't know why not everyone is using it...
I am trying to containerize the automation tests to run in docker environment. When the build runs on the automation code, it creates an docker image and updates in DTR. I have a separate jenkins pipeline which runs the automation commands in the docker image and uploads the results in the workspace. All of this setup working in fine in non-docker environment (ie., on local mac terminal), but the same tests are failing in docker environment. I am trying to figure out a solution, but it doesn't seem to work.
I get below errors when running the protractor tests in docker environment
After # test/cucumber/stepDefinitions/hooks.ts:31
WebDriverError: invalid session id
(Driver info: chromedriver=73.0.3683.68 (47787ec04b6e38e22703e856e101e840b65afe72),platform=Linux 4.9.125-linuxkit x86_64)
I built my docker image FROM circleci/node (https://hub.docker.com/r/circleci/node/) and this image has required libraries installed (node, npm,yarn, chrome and chrome drivers).
Before running the tests I made sure the protractor, cucumber and webdriver modules are installed.
Even then, i am trying to install chrome and chrome driver while building the image using apt-get package manager.
The docker env is on Debian GNU/Linux 9 \n \l
The chrome driver version is
73.0.3683.75-1~deb9u1
Google Chrome version is 73.0.3683.103
I am running headless
Making sure the webdriver manager is updated before starting it
Web driver version 13.0
Running below:
webdriver-manager update --ignore_ssl --versions.chrome 73.0.3683.75-1~deb9u1
webdriver-manager start --detach
protractor test/cucumber/config/cucumberConfig.ts
I expect all the tests to run in docker environment in the same way it ran in mac terminal, but getting below errors:
And Log out application # test/cucumber/stepDefinitions/common-step-def.ts:64
✖ After # test/cucumber/stepDefinitions/hooks.ts:31
WebDriverError: invalid session id
(Driver info: chromedriver=73.0.3683.68 (47787ec04b6e38e22703e856e101e840b65afe72),platform=Linux 4.9.125-linuxkit x86_64)
at Object.checkLegacyResponse (/node_modules/selenium-webdriver/lib/error.js:546:15)
at parseHttpResponse (/node_modules/selenium-webdriver/lib/http.js:509:13)
at doSend.then.response (/node_modules/selenium-webdriver/lib/http.js:441:30)
at
at process._tickCallback (internal/process/next_tick.js:189:7)
From: Task: WebDriver.takeScreenshot()
at thenableWebDriverProxy.schedule (/node_modules/selenium-webdriver/lib/webdriver.js:807:17)
at thenableWebDriverProxy.takeScreenshot (/node_modules/selenium-webdriver/lib/webdriver.js:1085:17)
at run (/node_modules/protractor/built/browser.js:59:33)
at ProtractorBrowser.to.(anonymous function) [as takeScreenshot] (/node_modules/protractor/built/browser.js:67:16)
at World. (/test/cucumber/stepDefinitions/hooks.ts:36:17)
Any thoughts?
I run into the same problem recently. It looks like browser instance can't start due to some reason. In my case adding --disable-dev-shm-usage to chrome-options solved the issue.
ChromeOptions options = new ChromeOptions();
options.addArguments("--disable-dev-shm-usage");
ChromeDriver driver = new ChromeDriver(options);
Why this helps:
By default, Docker runs a container with a /dev/shm shared memory space 64MB. This is typically too small for Chrome and will cause Chrome to crash when rendering large pages. To fix, run the container with docker run --shm-size=1gb to increase the size of /dev/shm. Since Chrome 65, this is no longer necessary. Instead, launch the browser with the --disable-dev-shm-usage flag:
~ Google troubleshooting guide
According to that, another idea would be to try using --shm-size=1gb when running the container if you really want to use /dev/shm.
May be check the Chrome version compatible with the OS version you are using in the Docker.
From the logs it seems the page is not even loaded or crashed on loading. Either it requires more memory to load the page or the chromes extensions might have been enabled.
try adding these options to config
chromeOptions: {
args: [
'incognito',
'disable-extensions',
'disable-infobars',
]
}
I installed Jenkins' Gradle plugin and used the automatic restart option via the Jenkins web interface. Jenkins seemed to hang on the "restarting..." page, so I finally tried to manually restart the Jenkins service on the server (64-bit Debian 7) using service jenkins restart.
Now, Jenkins is no longer running at all (verified with ps -ef | grep -i [J]enkins and service jenkins status), and when I try service jenkins [re]start, I see an [ ok ] message but nothing else seems to happen. I've deleted /var/log/jenkins/jenkins.log, and each time I try a service start (or restart), the log file reappears, but it's blank (ls -lA shows that the file was recently made, but cat produces no output). I also tried rebooting the server, with no effect. I finally deleted the Gradle folders under /var/lib/jenkins/plugins, which also did not appear to make a difference.
How do I even begin to approach this problem? Should I just re-install Jenkins?
EDIT: System info:
> uname -a
Linux AUC-Workstation1 3.2.0-4-amd64 #1 SMP Debian 3.2.68-1+deb7u1 x86_64 GNU/Linux
According to dpkg -l, I'm using Debian's jenkins package, version 1.617.
EDIT 2: I'm actually using the jenkins package provided directly by Jenkins, as per the instructions here.
I just had a problem where multiple Jenkins plugins were breaking Jenkins startup (after an upgrade) and here is the procedure I followed to resolve the issue, which might work for other plugin startup issues.
I'm working on an Ubuntu server, but I expect that this would work for Debian if it's going to work at all - I encourage others to adjust the procedure:
logged into the server and switched to the jenkins user (sudo su jenkins in my case)
went to the main jenkins directory
renamed plugins to plugins.problems_YYYYMMDD
previously, I attempted to disable the plugins, but this did not work for me (system still would not start)
created an empty directory plugins
restarted jenkins (sudo service jenkins restart)
In my case, this started just fine
iteratively followed the following procedure to add plugins back in
copied 1 or more plugins from plugins.problems_YYYYMMDD/ to plugins/
restarted jenkins
went to the plugin center and installed updates as available
sometimes I needed to install updates in a particular order due to dependencies
evaluated results in 'Manage Old Data'
I think I'm facing some manual updates of the old data
Note: if you know which plugins are likely the problem, then it is easier to just disable or temporarily (re)move them rather than (re)moving all of the plugins!
I never did figure out the initial problem, but I did get Jenkins working again, sort of.
I uninstalled Jenkins (using apt-get purge) and then re-installed it. This time it failed to start because it needed Java 7, but I apparently only had Java 6 installed (this surprised me, because I thought I had previously configured Jenkins to use Java 7 on that machine). So I installed openjdk-7-jdk and openjdk-7-jre, set JAVA and JAVA_HOME appropriately in the Jenkins config file, and started the service again. This allowed Jenkins to start.
This morning I've started playing with Docker, so installed boot2docker on my Mac.
All seemed to be going well, following the Working with Docker Images documentation until I tried to create a Dockerfile to install the ruby gems.
I spent a long time banging my head against the wall as to why it couldn't connect to install the gems... then I eventually worked it out, so adding this here in case anyone else has this problem in future, as there wasn't anything on Google about it.
Turns out that, because my internet bombed out during the apt-get update command, it didn't complete the update, however running it again, docker was using the cached (incomplete) data, and so if didn't work.
The fix... Run the docker build without the cache using the command...
docker build -no-cache --tag="<vendor>/<build>:<tag>" .
I have been having problems installing programs for a while, Usually getting an error that Visual Studio j# install is an unfinished install and it gives me an option to rollback that install before installing the program I am trying to install.
I am now trying to install Team Foundation Server 2012 Express and when I run the installer I get the following error.
Error : TF400293 : Windows is currently installing another package. Wait until Windows finishes the other installation, and then restart this setup program.
Can anyone give me some advice on how to get rid of the failed installation once and for all so I can install other stuff without all these problems.
Im using windows 7 by the way.
Also I seem to be unable to fully complete a Windows Update. It seems like there is 1 update that will never install and my computer just hangs on the installing update screen. I left it for 4+ hours once and decided it would not complete so had to just turn off my computer.
You've got this error message when a setup failed but the MSIEXEC.exe is still running or when there's a restart pending blocking other installation.
For the first case: kill the MSIEXE.exe process.
For the second: Use regedit to look at this key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations Clear out any value in the key and then try again.
This issue is not TFS related, by the way.