I'm running test using behat, but this basically runs phpunits selenium driver, to do integration tests
everything was working fine but for no apparent reason firefox quits at some point in the middle of my test suite the selenium rc log looks like this
09:23:53.157 INFO - Command request: setTimeout[30000, ] on session 62b513ea550a419898a79f912beecc69
09:23:53.180 INFO - Got result: OK on session 62b513ea550a419898a79f912beecc69
09:23:53.263 INFO - Command request: open[/request/step1, ] on session 62b513ea550a419898a79f912beecc69
09:23:53.318 INFO - Got result: XHR ERROR: URL = http://local-test.account/request/step1 Response_Code = -1 Error_Message = Request Error on session 62b513ea550a419898a79f912beecc69
09:23:53.321 INFO - Command request: testComplete[, ] on session 62b513ea550a419898a79f912beecc69
09:23:53.321 INFO - Killing Firefox...
09:23:53.356 INFO - Got result: OK on session 62b513ea550a419898a79f912beecc69
09:23:53.371 INFO - Command request: open[/request/step1, ] on session null
09:23:53.374 ERROR - Exception running 'open 'command on session null
at what point in the test it quits doesn't seem to follow any pattern.
i've tried rolling my projects code back to before I was having problems but to no avail
If you are using Selenium 1.3, try upgrading to Selenium 2.0. Here is how I resolved my problem with selenium.open();
This is possible when you are not passing correct website address. What are you passing, what is the URL of your website.
Related
I'm using webdriverIO for some automation testing and have recently migrated from 'selenium-standalone' service to default wdio devtools protocol.
wdio v.7.16.12
firefox v.95.0.2
From that point I can't start testing with firefox browser:
INFO #wdio/cli:launcher: Run onPrepare hook
INFO #wdio/cli:launcher: Run onWorkerStart hook
INFO #wdio/local-runner: Start worker 0-0 with arg: run,wdio.conf.js
INFO #wdio/local-runner: Run worker command: run
...
INFO devtools:puppeteer: Initiate new session using the DevTools protocol
ERROR #wdio/runner: Error: Couldn't find executable for browser
...
INFO #wdio/cli:launcher: Run onComplete hook
I've tried different combinations of options with 'wdio:devtoolsOptions' and 'moz:firefoxOptions'.
Plus checked whether could help dumpio: true, and 'moz:debuggerAddress': true options.
Also I've tried substitution browserName with product and adding binary and executablePath to capabilities.
When passing binary: 'path.to.firefox' to 'moz:firefoxOptions' options, the error message changes to:
ERROR #wdio/runner: Error: Only Nightly release channel is supported in Devtools/Puppeteer for Firefox. Refer to the following issue:
...
Any ideas how it could be fixed in webdriverIO (without installing separately puppeteer or puppeteer-firefox)?
Thanks!
Seems that I took desired for real.
wdio + devtools:puppeteer still work with Firefox Nightly only – https://github.com/webdriverio/webdriverio/discussions/7916
We have a problem when we run our nightwatch tests in parallel and there is a problem with the setup, for example the selenium grid is not available. The tests execute very quickly and we get no error messages.
Started child process for: folder1/test1
Started child process for: folder1/test2
Started child process for: folder1/test3
Started child process for: folder1/test4
>> folder1/test1 finished.
>> folder1/test2 finished.
>> folder1/test3 finished.
>> folder1/test4 finished.
But when I run the tests serially, I get a good error message like
Error retrieving a new session from the selenium server
Connection refused! Is selenium server started?
{ status: 13,
value: { message: 'Error forwarding the new session Empty pool of VM for setup Capabilities [{acceptSslCerts=true, name=Test1, browserName=chrome, javascriptEnabled=true, uuid=ab54872b-10ee-43a1-bf65-7676262fa647, platform=ANY}]',
class: 'org.openqa.grid.common.exception.GridException' } }
Why don't I get the good error message when running in parallel mode? Is there something I can change so I get the good error message in parallel mode?
By setting
live_output: true
in your nightwatch config file, you'll see logs while running in parallel.
More information: config-basic
I set up a standard yeoman/angular installation on Mac OS X 10.8.3 using npm. I created a new angular project using the yo generator. I installed phantomjs via npm install -g phantomjs. I configured karma to unly use phantomjs (all other browsers work fine). When running tests with grunt test, phantomjs does not capture at all, even if I set a very long timeout (50000ms). This is the log output:
Running "karma:unit" (karma) task
DEBUG [reporter]: Using reporter "progress".
INFO [karma]: Karma server started at http://localhost:8080/
INFO [launcher]: Starting browser PhantomJS
DEBUG [launcher]: Creating temp dir at /var/folders/6j/gz50dm2d3xv1hnz7s1t4lhn40000gp/T/testacular-79891032
DEBUG [launcher]: /usr/local/bin/phantomjs /var/folders/6j/gz50dm2d3xv1hnz7s1t4lhn40000gp/T/testacular-79891032/capture.js
WARN [watcher]: Pattern "/Users/alexanderwalter/Development/angularSeed/test/mock/**/*.js" does not match any file.
DEBUG [watcher]: Resolved files:
/Users/alexanderwalter/Development/angularSeed/node_modules/grunt-karma/node_modules/karma/adapter/lib/jasmine.js
/Users/alexanderwalter/Development/angularSeed/node_modules/grunt-karma/node_modules/karma/adapter/jasmine.js
/Users/alexanderwalter/Development/angularSeed/app/components/angular/angular.js
/Users/alexanderwalter/Development/angularSeed/app/components/angular-mocks/angular-mocks.js
/Users/alexanderwalter/Development/angularSeed/app/scripts/app.js
/Users/alexanderwalter/Development/angularSeed/app/scripts/controllers/add.js
/Users/alexanderwalter/Development/angularSeed/app/scripts/controllers/main.js
/Users/alexanderwalter/Development/angularSeed/test/spec/controllers/add.js
/Users/alexanderwalter/Development/angularSeed/test/spec/controllers/main.js
DEBUG [web server]: serving: /Users/alexanderwalter/Development/angularSeed/node_modules/grunt-karma/node_modules/karma/static/client.html
DEBUG [web server]: serving: /Users/alexanderwalter/Development/angularSeed/node_modules/grunt-karma/node_modules/karma/static/testacular.js
DEBUG [karma]: New browser has connected on socket wxBffi5IEZn9zQvoTm0J
WARN [launcher]: PhantomJS have not captured in 50000 ms, killing.
DEBUG [launcher]: Process PhantomJS exitted with code 1
ERROR [launcher]: Cannot start PhantomJS
As I said, it works for all other browsers. Phantomjs also works if I pass it a simple test script which prints hello world to the console.
I had the same issue and found out it was a problem with nodejs 0.10.8/0.10.9: https://github.com/karma-runner/karma/issues/558
Downgrading to nodejs 0.10.7 solved the problem for me.
In case you want to go with node 0.10.11, the Proxy option worked for me (Mac 10.6.8, Karma 0.8.5, and node 0.10.11 or 0.10.7. Node 0.10.8/9/10 didn't work.).
Inside the karma.conf.js file:
proxies = {
'/': 'http://localhost:9000'
};
urlRoot = '/__unit/';
Inside the karma-e2e.conf.js file:
proxies = {
'/': 'http://localhost:9000'
};
urlRoot = '/__e2e/';
I upgraded to the latest stable version of Node.js. This solved it for me. currently v.10.20.
I want start firefox with my custom profile, and when I add some plugins (for example) in this session starting from selenium I want he do not forgot them.
I started selenium server
start "JAVA Selenium Server" java -jar selenium-server.jar -interactive -firefoxProfileTemplate "D:\Ogame\SeleniumStaticProfile"
Then in selenium server
cmd=getNewBrowserSession&1=*custom firefox.exe -p SeleniumStatic -no-remote&2=http://www.google.com
cmd=open&1=httttp://www.hotmail.com
cmd=open&1=httttp://www.google.pl
and i'm gettings error something like:
www.goole.com havent rights to read properties Window.seleniumMarker1299...
All log:
cmd=getNewBrowserSession&1=*custom firefox.exe -p SeleniumStatic
-no-remote&2=ht tttp://www.google.com 13:54:50.817 INFO - ---> Requesting
htttttp://localhost:4444/selenium-server/driver
?cmd=getNewBrowserSession&1=*custom
firefox.exe -p SeleniumStatic
-no-remote&2=h tttttp://www.google.com 13:54:50.823 INFO - Command request:
getNewBrowserSession[*custom
firefox.exe -p SeleniumStatic
-no-remote, htttttp://www.google.com] on session null 13:54:50.824 INFO -
creating new remote session
13:54:50.832 INFO - Allocated session
ad3e48137d024959863ab8bb4c297d55 for
httttp: //www.google.com, launching...
13:54:54.615 INFO - Got result:
OK,ad3e48137d024959863ab8bb4c297d55 on
session a
d3e48137d024959863ab8bb4c297d55
cmd=open&1=http://www.wp.pl
13:55:23.588 INFO - ---> Requesting
httttp://localhost:4444/selenium-server/driver
?cmd=open&1=htttttp://www.wp.pl&sessionId=ad3e48137d024959863ab8bb4c297d55
13:55:23.595 INFO - Command request:
open[htttttp://www.wp.pl, ] on session
ad3e481 37d024959863ab8bb4c297d55
13:55:23.596 WARN - you appear to be
changing domains from
httttp://www.google.com to
htttttp://www.wp.pl this may lead to a
'Permission denied' from the browser
(unless it is running as *iehta or
*chrome, or alternatively the selenium server is runnttting in proxy
injection mode) 13:55:23.691 INFO -
Got result: Witrynie
http://www.google.com nie udzielono
u prawnien do odczytania wlasciwosci
Window.document z
on sessi on
ad3e48137d024959863ab8bb4c297d55
Of course I have entered proxy in Firefox SeleniumStatic profile (localhost:4444)
What am I doing wrong?
Sorry for my bad english :/
Change your commands to look like the following
cmd=getNewBrowserSession&1=*firefox -no-remote&2=http://www.google.com
cmd=open&1=httttp://www.hotmail.com
cmd=open&1=httttp://www.google.pl
YOu don't need to specify the profile since you have already done that when starting the Selenium Server.
I'm running Selenium RC with PHP.
I run a simple login test, that completes successfully, but just before closing the browser, I get the following error:
23:50:09.969 INFO - Command request: testComplete[, ] on session
d7a1effeabc24b0b9b46ad6fdb3eebec 23:50:09.969 INFO - Killing Google
Chrome... 23:50:10.286 INFO - Got result: OK on session
d7a1effeabc24b0b9b46ad6fdb3eebec 23:50:10.349 INFO - Command request:
getLocation[, ] on session null 23:50:10.351 ERROR - Exception running
'getLocation 'command on session null java.lang.NullPointerException:
sessionId should not be null; has this session been started yet?
at org.openqa.selenium.server.FrameGroupCommandQueueSet.getQueueSet(FrameGroupCommandQueueSet.java:216)
at org.openqa.selenium.server.commands.SeleniumCoreCommand.execute(SeleniumCoreCommand.java:34)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.doCommand(SeleniumDriverResourceHandler.java:562)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.handleCommandRequest(SeleniumDriverResourceHandler.java:370)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.handle(SeleniumDriverResourceHandler.java:129)
at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1530)
at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1482)
at org.openqa.jetty.http.HttpServer.service(HttpServer.java:909)
at org.openqa.jetty.http.HttpConnection.service(HttpConnection.java:820)
at org.openqa.jetty.http.HttpConnection.handleNext(HttpConnection.java:986)
at org.openqa.jetty.http.HttpConnection.handle(HttpConnection.java:837)
at org.openqa.jetty.http.SocketListener.handleConnection(SocketListener.java:245)
at org.openqa.jetty.util.ThreadedServer.handle(ThreadedServer.java:357)
at org.openqa.jetty.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
23:50:10.364 INFO - Got result: ERROR Server Exception: sessionId
should not be null; has this session been started yet? on session null
I can't find a solution...
Please help.
The problem was the stop() call within tearDown(). Removing it fixed the problem.
Adding these lines in the setUp() helped:
$this->start();
sleep(1);