I’m testing with internJs, I want to launch tests in safari browser:
hub machine: Windows 8.1
node machine: Mac Os X El Capitan Version 10.11.6 === Safari version: 10.1.1
In the hub i run:
java –jar selenium-server-standalone-3.4.0.jar –role hub
In the node machine i run:
java –jar selenium-server-standalone-3.4.0.jar –role webdriver –hub http://192.168.1.2:4444/grid/register -port 5566
Also I installed SafariDriver.safariextz
error:
C:\dev\E2E_Test_WebTv>intern-runner config=tests/intern
Listening on 0.0.0.0:9000
Tunnel started
Suite safari on MAC FAILED
UnknownError: [POST http://localhost:4444/wd/hub/session /
{"desiredCapabilities
":{"selenium-server-standalone":"3.4.0","name":"tests/intern","idle-
timeout":60,
"browserName":"safari","platform":"MAC"}}] Error forwarding the new session
Empt y pool of VM for setup Capabilities [{name=tests/intern,
browserName=safari, idl e-timeout=60, selenium-server-standalone=3.4.0,
platform=MAC}] at Server.createSession
users\Test\AppData\Roaming\npm\node_modules\in
tern\node_modules\leadfoot\Server.js:355:15>
at
<..\..\Users\Test\AppData\Roaming\npm\node_modules\intern\lib\executors\Run
ner.js:198:23>
at retry
<..\..\Users\Test\AppData\Roaming\npm\node_modules\intern\lib\util.j
s:818:13>
at
<..\..\Users\Test\AppData\Roaming\npm\node_modules\intern\node_modules\dojo
\Promise.ts:393:15>
at runCallbacks
<..\..\Users\Test\AppData\Roaming\npm\node_modules\intern\nod
e_modules\dojo\Promise.ts:11:11>
at
<..\..\Users\Test\AppData\Roaming\npm\node_modules\intern\node_modules\dojo
\Promise.ts:317:4>
at run
<..\..\Users\Test\AppData\Roaming\npm\node_modules\intern\node_modules
\dojo\Promise.ts:237:7>
at
<..\..\Users\Test\AppData\Roaming\npm\node_modules\intern\node_modules\dojo
\nextTick.ts:44:3>
at _combinedTickCallback <internal\process\next_tick.js:73:7>
at process._tickCallback <internal\process\next_tick.js:104:9>
TOTAL: tested 0 platforms, 0/0 tests failed; fatal error occurred
Error: Run failed due to one or more suite errors
at emitLocalCoverage
<..\..\Users\Test\AppData\Roaming\npm\node_modules\inter
n\lib\executors\Executor.js:363:18>
at finishSuite
<..\..\Users\Test\AppData\Roaming\npm\node_modules\intern\lib\
executors\Executor.js:380:15>
at
<..\..\Users\Test\AppData\Roaming\npm\node_modules\intern\lib\executors\Exe
cutor.js:388:8>
at
<..\..\Users\Test\AppData\Roaming\npm\node_modules\intern\browser_modules\d
ojo\Promise.ts:393:15>
at runCallbacks
<..\..\Users\Test\AppData\Roaming\npm\node_modules\intern\bro
wser_modules\dojo\Promise.ts:11:11>
at
<..\..\Users\Test\AppData\Roaming\npm\node_modules\intern\browser_modules\d
ojo\Promise.ts:317:4>
at run
<..\..\Users\Test\AppData\Roaming\npm\node_modules\intern\browser_modu
les\dojo\Promise.ts:237:7>
at
<..\..\Users\Test\AppData\Roaming\npm\node_modules\intern\browser_modules\d
ojo\nextTick.ts:44:3>
at _combinedTickCallback <internal\process\next_tick.js:73:7>
at process._tickCallback <internal\process\next_tick.js:104:9>
Related
I get the following error when I run this command on headless ubuntu 20.04
selenium-side-runner -c "browserName=chrome chromeOptions.args=[disable-infobars, headless]" myproject.side
info: Running Mynew.side
FAIL MySuiteOne/MytestOne.test.js
● Test suite failed to run
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.)
at Object.throwDecodedError (../../usr/lib/node_modules/selenium-side-runner/node_modules/selenium-webdriver/lib/error.js:550:15)
at parseHttpResponse (../../usr/lib/node_modules/selenium-side-runner/node_modules/selenium-webdriver/lib/http.js:560:13)
at Executor.execute (../../usr/lib/node_modules/selenium-side-runner/node_modules/selenium-webdriver/lib/http.js:486:26)
Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: 0.255s
Ran all test suites.
My Chrome version:91.0.4472.77 installed in /usr/bin/google-chrome
Chrome driver version: chromedriver#90.0.1
I also tried commands
selenium-side-runner /path/to/your-project.side
selenium-side-runner -c "browserName=chrome chromeOptions.args=[headless, no-sandbox, disable-dev-shm-usage, disable-infobars] chromeOptions.binary='/usr/bin/google-chrome'" Mynew.side
But still, I am facing the same error. Is there any way to fix this. I am trying to configure selenium in Ubuntu 20.04 Amazon EC2 instance.
Per the Chromedriver Download page,
If you are using Chrome version 91, please download ChromeDriver 91.0.4472.19
I'm using Selenium for testing from Java code, it's started automatically with maven, when I run mvn verify it uses gecko-driver to start new firefox instance for selenium:
final FirefoxOptions opts = new FirefoxOptions();
if (HEADLESS_MODE) {
opts.addArguments(ARG_HEADLESS);
}
return new FirefoxDriver(opts);
It's working fine on my machine (and on machines of other developers) in both modes "headless" and normal. Now I'm trying to run Selenium tests with CI builds in Alpine Linux Docker container. When I tried to run it as-is, I've got an error:
mozrunner::runner INFO Running command: "/usr/bin/firefox"
"-marionette" "--headless" "-foreground" "-no-remote"
"-profile" "/tmp/rust_mozprofile.pW1sbkcv98QN"
Error: GDK_BACKEND does not match available displays.
Then I installed all suggested tools (dbus and xvfb) from this post and started it before running tests:
apk add xvfb dbus
dbus-uuidgen > /etc/machine-id
export DISPLAY=:99
Xvfb $DISPLAY -ac &
mvn verify
but now Selenium tests are hadning for about 10 seconds and failing with error
1565433736375 mozrunner::runner INFO Running command: "/usr/bin/firefox" "-marionette" "--headless" "-foreground" "-no-remote" "-profile" "/tmp/rust_mozprofile.1ZMsJ0Hy95V0"
1565433738424 Marionette INFO Listening on port 2828
!!! [Child][MessageChannel] Error: (msgtype=0x3E0003,name=PCompositable::Msg_Destroy) Channel error: cannot send/recv
[Child 2191] ###!!! ABORT: Aborting on channel error.: file /home/buildozer/aports/community/firefox-esr/src/firefox-52.8.1esr/ipc/glue/MessageChannel.cpp, line 2152
[Child 2191] ###!!! ABORT: Aborting on channel error.: file /home/buildozer/aports/community/firefox-esr/src/firefox-52.8.1esr/ipc/glue/MessageChannel.cpp, line 2152
!!! [Child][MessageChannel] Error: (msgtype=0x3E0003,name=PCompositable::Msg_Destroy) Channel error: cannot send/recv
It seems I'm doing something wrong here, what is the correct way to run headless Selenium tests in Alpine Linux Docker container? I'd prefer to configure existing Docker image instead of using Selenium images, because the migration will be expensive.
Update:
Selenium version is 3.141.59
Gecko-driver version is v0.24.0-linux64
Firefox-ESR version is: 52.8.1-r0
Update2:
xvfb, dbus and exported DISPLAY are not actually needed to run Firefox in headless mode - just run firefox --headless and it's all.
As per Mozilla --headless flag is not supported in Firefox 52-esr.Headless flag was introduced in version 55 (for Linux) and 56 (Mac/Windows) . Please try on latest Firefox ESR release.
I am trying to run the selenium server standalone in a vagrant box, with the following command:
java -jar selenium-server-standalone-3.13.0.jar
When I click the 'create session' button at http://lab.local:4444/wd/hub/static/resource/hub.html from my host web browser. I get a unable to create a new session error message.
I ask to create a firefox browser session for which I get the driver located in /usr/local/bin/geckodriver.
Firefox has been installed on the vagrant box with sudo apt install firefox-esr.
Error log detail:
14:52:04.485 INFO [GridLauncherV3.launch] - Selenium build info: version: '3.13.0', revision: '2f0d292'
14:52:04.486 INFO [GridLauncherV3$1.launch] - Launching a standalone Selenium Server on port 4444
2018-08-09 14:52:04.564:INFO::main: Logging initialized #312ms to org.seleniumhq.jetty9.util.log.StdErrLog
14:52:04.757 INFO [SeleniumServer.boot] - Selenium Server is up and running on port 4444
14:52:15.563 INFO [ActiveSessionFactory.apply] - Capabilities are: {
"browserName": "firefox"
}
14:52:15.568 INFO [ActiveSessionFactory.lambda$apply$11] - Matched factory org.openqa.selenium.remote.server.ServicedSession$Factory (provider: org.openqa.selenium.firefox.GeckoDriverService)
1533819135611 geckodriver INFO geckodriver 0.21.0
1533819135614 geckodriver INFO Listening on 127.0.0.1:25541
1533819135880 mozrunner::runner INFO Running command: "/usr/bin/firefox" "-marionette" "-foreground" "-no-remote" "-profile" "/tmp/rust_mozprofile.yuusnpGo8Gw6"
1533819136508 Marionette INFO Listening on port 2828
When I run the same executable directly from my host, I get no error and the firefox session is created with success.
I try to run a X server, Xvfb as follow but this does not change anything:
Xvfb :1 -screen 0 1600x1200x16 &
export DISPLAY=:1
java -jar selenium-server-standalone-3.13.0.jar
Problem solved after switching to selenium-server-standalone-3.3.1.jar with geckodriver 0.14.0. Sessions are created with success with this configuration.
source.
I can access url and create sessions:
http://localhost:4444/wd/hub/static/resource/hub.html
but when i execute ./codecept run i get an error, but i have Selenium Server running:
[ConnectionException] Can't connect to Webdriver at http://127.0.0.1:4444/wd/hub. Please make sure that Selenium Server or PhantomJS is running.
To execute Selenium Server, i used this command:
java -Dwebdriver.gecko.driver=./geckodriver -jar "selenium-server-standalone-3.12.0.jar"
I tried too with IE and Chrome (i have the same problem too):
java -Dwebdriver.chrome.driver=./chromedriver -jar "selenium-server-standalone-3.12.0.jar"
java -Dwebdriver.ie.driver=./IEDriverServer -jar "selenium-server-standalone-3.12.0.jar"
acceptance.suite.yml
class_name: AcceptanceTester
modules:
enabled:
- WebDriver
- \Helper\Acceptance
config:
WebDriver:
url: 'http://localhost'
browser: firefox
window_size: 820x1000
Codeception Version: 2.4.1
WebDriver Chrome Version: 2.38 (win32)
WebDriver Firefox Version: 0.20.1 (x64)
Chrome Version: 66.0.3359.139 (64-bit)
Firefox Version: Firefox Quantum 60.0 (64-bit)
Windows Version: Windows 8.1 64bit
Selenium Version: 3.12.0
To start Selenium Server you need not require to pass/specify the WebDriver variant and you can start the Selenium Server as follows :
Command :
>java -jar selenium-server-standalone-3.12.0.jar
Console Logs :
C:\Utility\selenium-server-standalone>java -jar selenium-server-standalone-3.12.0.jar
15:28:28.249 INFO [GridLauncherV3.launch] - Selenium build info: version: '3.12.0', revision: '7c6e0b3'
15:28:28.251 INFO [GridLauncherV3$1.launch] - Launching a standalone Selenium Server on port 4444
2018-05-11 15:28:28.361:INFO::main: Logging initialized #467ms to org.seleniumhq.jetty9.util.log.StdErrLog
15:28:28.860 INFO [SeleniumServer.boot] - Selenium Server is up and running on port 4444
Snapshot of the Resource Hub :
Update
As per the documentation at codeception.com the acceptance.suite.yml should have been as follows :
modules:
enabled:
- WebDriver:
url: 'http://localhost/'
browser: firefox
window_size: 820x1000
Problem fixed. I was using proxy.
For future users with same problem like me, can follow the steps.
First, check if you have proxy defined with this command:
echo %http_proxy%
If return some result, you need set a empty proxy with this command:
set http_proxy=
You need define a proxy always you are opening a new command line.
I m unable to run my test cases using chrome browser on centos 7. i m using chromedriver version 2.30.477691
and chrome binary version
# google-chrome -version
Google Chrome 59.0.3071.109
running the testcases with root so tried --no-sandbox option didnt work . also tried with no such options in command line.
Please help.
[root#Server ~]# time xvfb-run -a -s "-screen 0 1024x768x24" java
-jar Project.jar -Dwebdriver.chrome.binary=/usr/bin/google-chrome --no-sandbox
Starting ChromeDriver 2.30.477691 (6ee44a7247c639c0703f291d320bdf05c1531b57) on port 26527 Only local connections are allowed. Exception in thread "main" org.openqa.selenium.WebDriverException: chrome not reachable (Driver info: chromedriver=2.30.477691 (6ee44a7247c639c0703f291d320bdf05c1531b57),platform=Linux
3.10.0-514.21.1.el7.x86_64 x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout:
114.41 seconds