PhantomJS throws "Unable to access network" in TeamCity - jasmine

I'm testing an AngularJS application and I've set up PhantomJS 2.0 to be executed in my TeamCity configration together with Jasmine 2.2.
The step in TeamCity is of type Command Line.
It points to the PhantomJS executable, and has two parameters set:
path\to\run-jasmine.js other\path\specRunner.html
When the build step is executed I get the following error in TeamCity:
"Unable to access network"
I've also tried to run it locally with cmd:
phantomjs.exe \different\path\run-jasmine.js other\path\specRunner.html
However I get the same error message...
Any ideas why this error is thrown?

I found out that I had to specify the paths with "/" rather than "\" .
This was the correct approach:
path/to/run-jasmine.js path/to/SpecRunner.html

Related

Server agent not opening in JMeter

I installed serverAgent 2.2.3
When I run it in cmd I get this error.
enter image description here
I tried starting the startAgent. bat. It automatically closes.
Thanks for looking.
That's very weird because the error states that sl4j library cannot be found in CLASSPATH and ServerAgent doesn't use this library at all.
Try downloading it from Github and unpacking it somewhere else. Also if you have CLASSPATH environment variable set - try clearing/unsetting it.
set CLASSPATH= && startAgent.bat
More information: How to Monitor Your Server Health & Performance During a JMeter Load Test
Alternatively you can try downloading sl4j.jar and dropping it near ServerAgent.jar but it is not a part of normal ServerAgent installation procedure.

Karate-Jenkins- ERROR com.intuit.karate - . getting this error only when i run from jenkins

iam running my karate code from Jenkins. where ia, getting below error.
ERROR com.intuit.karate - evaluation of 'karate-config.js' failed: javascript function call failed: ReferenceError: "karate" is not defined .
karate config file keeps on running.
iam using mvn test command to run the job.. even I have tried in Jenkins machine and mvn command works. only in through Jenkins iam getting issue.
Try to upgrade java version in Jenkins server.

Sonar Runner 404 localhost

I'm trying to get Sonar working locally on an OS X box to do some proof of concept work, I've downloaded the following:
Sonar Qube: 4.5.6
Sonar Runner: 2.4
Sonar Qube is configured as:
sonar.web.host=localhost
sonar.web.context=/sonar
sonar.web.port=9000
When I try and use Sonar Runner with one of the example projects I get the following error:
ERROR: Error during Sonar runner execution
ERROR: Fail to request server version
ERROR: Caused by: Status returned by url : 'http://localhost:9000/sonar/api/server/version' is invalid : 404
If I copy and paste the URL from the console into the browser then the page loads (displaying 4.5.6).
What could be causing the script to receive a 404?
The box is behind a proxy but nothing should be trying to get to the outside world
UPDATE:
Changing the configuration from localhost to using the machines IP address produces a timeout rather than a 404, everything still works fine through the browser.
So it turned out my problem was that the JVM wasn't using the proxy settings of my machine, I had to add the following to the Sonar runner script.
SONAR_RUNNER_OPTS="-Dhttp.proxyHost=myproxy -Dhttp.proxyPort=80 -Dhttp.nonProxyHosts=my.local.host"
It's possible that HTTP queries from sonar-runner are routed based on system proxy settings, while your browsers may use their own proxy settings.
Go check the system-wide setting:
System Preferences/Network/Advanced/Proxies/Bypass proxy settings for these Hosts & Domains
And make sure that localhost/127.0.0.1 is in there.

Headless testing display error

Background
I am running a set of selenium tests using a Maven and Jenkins with Testng. I had them working fine headlessly up until a week ago. Jenkins sits on the server accessible with port 8080. The tests also run fine through eclipse.
Software Versions
I have read lots about Firefox being incomparable with selenium so here is a list of software and versions that I am using.
Firefox: 39
Maven: 3.3.3
Java: 1.7.0_79
Selenium: 2.46 & 2.47(currently 2.47)
Jenkins: 1.622
Xvnc: 1.3.9
ubuntu 14
Error
After I run the tests and the fail I check the console through Jenkins. The error I am getting makes me think it's a problem with Xvnc and firefox but I can't pin point it. I get a NotConnectedException. The firefox console error has changed a few times here is a list of different errors the console has shown me.
Error: cannot open display: :87
firefox: Fatal IO error 11 (Resource temporarily unavailable) on X server :46.
firefox: Fatal IO error 2 (No such file or directory) on X server :78.
Research
I've been on bugzilla but cant find a conclusive answer to the problem.
I've also looked around SO but found no fixes.
Conclution
From what I have gathered it is something to do with Xvnc, Could running
sudo apt-get update
make changes to how Xvnc operates? I have updated the packages some time last week but our testers didn't check Jenkins properly when adding new tests and as such I've wasted and entire day trying to pin point when and what the problem is.
Question
What would cause Jenkins to return errors like this, how can I fix them and how can I prevent something doing this again?
EDIT 1
The display variable seems to be the issue, upon typing the command
echo $DISPLAY
There is no response just an empty line.
EDIT 2
running the command
export DISPLAY=:0.10
no gives the result
:0.10
when I echo $DISPLAY
I think the DISPLAY varibale is not functioning as expected and hence firefox is unable to connect to it. To know more about the $DISPLAY refer this link https://askubuntu.com/questions/432255/what-is-display-environment-variable
Try to run this command on the slave node where the job runs, this should give you the required setting for the tests to connect and run.
nohup /usr/bin/Xvfb :2 –screen 0 1024x768x24 > /dev/null 2>&1 &

Hudson Running as a Service not Starting

I downloaded Hudson, and am trying to install it as a service. I followed the steps from this page, but when I try to start the service, it always fails. I'm not really getting any defined error codes either. If I try to run the service from the command line (using net start) I get the following (unhelpful) message:
The hudson service could not be started.
The service did not report an error.
The install process seemed to work fine, as the hudson service is installed, and all the files are in the new directory, but the service won't start. Has anyone else run into this problem?
As documented on that page, they have a note of...
If a restart fails for some reason, check the output from Hudson, which is stored in the installation directory that you specified.
Is there anything to denote further errors?

Resources