All tests fail in Web Component Tester for Firefox - polymer

After creating a clean copy of the Polymer Starter Kit, running the tests using the Web Component Tester ("test" Gulp task) results in all tests failing in Firefox.
The tests run through fine in both Chrome and IE.
The error is:
firefox 39 ✖ my-greeting-basic.html
Timed out loading http://localhost:2000/components/polymer-starter/my-greeting-basic.html?
<unknown> at done at /components/mocha/mocha.js:1846:0
<unknown> at Runner.prototype.run/< at /components/mocha/mocha.js:5213:0
<unknown> at EventEmitter.prototype.emit at /components/mocha/mocha.js:616:0
<unknown> at start/< at /components/mocha/mocha.js:5203:0
<unknown> at Runner.prototype.runSuite at /components/mocha/mocha.js:5103:0
<unknown> at start at /components/mocha/mocha.js:5201:0
<unknown> at Runner.prototype.run at /components/mocha/mocha.js:5226:0
<unknown> at Mocha.prototype.run at /components/mocha/mocha.js:1849:0
<unknown> at g at /bower_components/webcomponentsjs/webcomponents.min.js:11:0
<unknown> at w at /bower_components/webcomponentsjs/webcomponents.min.js:11:0
<unknown> at f at /bower_components/webcomponentsjs/webcomponents.min.js:11:0
<unknown> at p at /bower_components/webcomponentsjs/webcomponents.min.js:11:0
404 GET /components/polymer-starter/my-list-basic.html
firefox 39 ✖ my-list-basic.html
Timed out loading http://localhost:2000/components/polymer-starter/my-list-basic.html?
firefox 39 Tests failed: 2 failed tests
Test run ended in failure: 2 failed tests
Process terminated with code 1.
In the browser the calls to the test suites result in 404s.

The issue is that Firefox in Windows screws up when it sees backslashes in a path. Took me forever to figure it out, but I've opened a ticket on the relevant project and submitted a pull request for a fix I came up with.
If you're impatient you can navigate to <your project>/node_modules/web_component_tester/runner/webserver.js and put the following before line 80(options.webserver.webRunnerContent = INDEX_TEMPLATE(options))
options.suites = options.suites.map(function (cv) {
return cv.replace(/\\/g,'/');
})
This will change backslashes in the path to forward slashes which Firefox doesn't have a problem with.

Related

finding Element causing chrome driver instance to crash

First the Environment:
Node JS 16.15.0
Web Driver io v7 (wdio)
wdio/cucumber framework
end to end testing of a website
-obviously using cucumber and feature files
using a test configuration file similar to wdio's
using wdio-chromedriver-service v7.2.6 and npm chromedriver package version ^107 to produce a browser to hit
my browser : chrome v107.0.5304.62
The Question:
an element cannot be found by webDriver as I expect, but the command causes the instance to crash
I am searching for an element that no longer appears on the page (it is a spinner element that shows the page is loading)
I call
if(await this.spinner.isDisplayed())
and then the test run hangs, the debugger tells me the command
INFO webdriver: COMMAND findElement("css selector", "i.fa-spinner")
is running and then nothing else, finally the renderer times out
WARN chromedriver: [SEVERE]: Timed out receiving message from renderer: 600.000
DEBUG webdriver: request failed due to response error: timeout
and the chrome instance crashes shortly later
I am unsure why this behavior is happening, is something wrong with my wdio configuration? or with my chrome driver?
What I have tried
I understand that
browser.setTimeout exists but
I am sure it is not set in my config anywhere.
I have done a global search (using vscode for all development) for browser.setTimeout (no results).
I have manually set browser.setTimeout({ 'implicit': 0 }) (no success).
I have also tried directly hitting a chrome driver instance by manually downloading a chrome driver exe that matched my browser version v107.0.5304.62 and removing the 'services: ['chromedriver']'
from my test config file
when this happens something very interesting occurs, I can keep running after searching for the element that broke the run before, but we dont get very far and the command still causes issues. Chrome driver is throwing errors like
error: 'no such element',
[0-0] message: 'no such element: Unable to locate element: {"method":"css selector","selector":"i.fa-spinner"}\n' +
[0-0] ' (Session info: chrome=107.0.5304.87)'
The browser closes shortly afterwards without progressing through the rest of the tests.
I find it interesting that the version that chrome driver says it is running is 107.0.5304.87 since the version of chromedriver I downloaded clearly says it is v107.0.5304.62 and my chrome version clearly states it is also v107.0.5304.62 .
though theoretically using v107.0.5304.87 shouldnt be an issue according to this
since the 107.0.5304 part matches across the board
I could use some assistance.
We had the same issue this days, seems there is a bug introduced in Chrome 106; try to change config or downgrade Chrome on the machine to use Chrome 105 as with this version is working.

RobotFramework - Close Browser - WebDriverException: Message: invalid session id

I am getting following error on last step of all my tests - because of that, all Test Cases are marked as failed.
Test Example:
*** Settings ***
Documentation TEST Close Browser
Library SeleniumLibrary
*** Test Cases ***
Google test
Open Browser about:blank chrome
Maximize Browser Window
Go To https://google.com
Close Browser
All steps executes correctly - even the last step closes browser, but it is throwing this error:
WebDriverException: Message: invalid session id
(Driver info: chromedriver=70.0.3538
.16(16ed95b41bb05e565b11fb66ac33c660b721f778)
,platform=Windows NT 10.0.17134 x86_64)
I am using latest chromedriver and all of my robotframework dependecies are also updated.
Can someone please help me get rid of that error?

Selenium - Uncaught WebDriverError: chrome not reachable

Currently I'm using the follow stack:
1. Selenium Webdriver 3.0.1 (NodeJS API)
2. Mocha
3. Chromedriver 2.25.3
Often when I run my tests in Codeship (continuous integration) I get this error:
Uncaught WebDriverError: chrome not reachable
(Driver info: chromedriver=2.25.426924 (649f9b868f6783ec9de71c123212b908bf3b232e),platform=Linux 4.2.0-42-generic x86_64)
Note: This never happened running locally, only occurs when my tests start in codeship, and it's an intermittent error (sometimes it happens, sometimes not)
Screenshot error:
Any ideia how solve this?
Does codeship have chrome installed on their test server?
I'm guessing not. It might be better to run this against phantomjs (headless browser) instead for CI purposes.

Karma test error after updating Chrome

This morning I ran my unit tests and everything worked as expected with some tests failing and several passing. Then I updated Chrome to version 55 and suddenly I receive the error below, and none of my tests even run:
WARN [karma]: No captured browser, open http://localhost:/
System configuration:
OS: Windows 10
IDE: VSCode 1.7.2
Karma 1.2.0
Add below lines of code to make it work .
mime: {
'text/x-typescript': ['ts', 'tsx']
}
Source: https://github.com/angular/angular-cli/issues/2125

compile & execute Chromium failed due to SUID sandbox issue

What I'm trying to do :
Compile and run Chromium source code on Ubuntu 13.10
Steps I've taken :
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
add to bashrc :
export PATH="$PATH":/home/y0.kim/project/depot_tools
export CHROME_DEVEL_SANDBOX=/usr/local/sbin/chrome-devel-sandbox
fetch --nohooks chromium --nosvn=True
git checkout master
build/install-build-deps.sh
git pull
gclient sync
ninja -C out/Debug chrome chrome_sandbox
build/update-linux-sandbox.sh
out/Debug/chrome -> Fail
out/Debug/chrome --no-sandbox -> Fail
Problem :
get the source code and compiled without problem.
However, when i execute chrome, i have below error
normal execution
:~/project2/src$ out/Debug/chrome
The setuid sandbox provides API version 1, but you need 0
Please read https://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment.
[37555:37588:0616/152604:FATAL:browser_main_loop.cc(207)] <unknown>: Command line `dbus-launch --autolaunch=f271cc756e9c41e457760b8c00000496 --binary-syntax --close-stderr' exited with non-zero exit status 1: Autolaunch error: X11 initialization failed.\n
#0 0x7f570456a39d base::debug::StackTrace::StackTrace()
#1 0x7f57045bc51d logging::LogMessage::~LogMessage()
#2 0x7f5707e45cef content::(anonymous namespace)::GLibLogHandler()
#3 0x7f5701c20f61 g_logv
#4 0x7f5701c21172 g_log
#5 0x7f56f5240d2a <unknown>
#6 0x7f56f5241087 <unknown>
#7 0x7f5701c19d13 g_main_context_dispatch
#8 0x7f5701c1a060 <unknown>
#9 0x7f5701c1a45a g_main_loop_run
#10 0x7f56f524098b <unknown>
#11 0x7f5701c3b9b5 <unknown>
#12 0x7f56fdfd0e9a start_thread
#13 0x7f56fc1853fd clone
Aborted (core dumped)
execution with --no-sandbox
~/project2/src$ out/Debug/chrome --no-sandbox
[19653:19653:0616/152447:ERROR:browser_main_loop.cc(161)] Running without the SUID sandbox! See https://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment for more information on developing with the sandbox on.
[19653:19656:0616/152447:FATAL:browser_main_loop.cc(207)] <unknown>: Command line `dbus-launch --autolaunch=f271cc756e9c41e457760b8c00000496 --binary-syntax --close-stderr' exited with non-zero exit status 1: Autolaunch error: X11 initialization failed.\n
#0 0x7f8f13bbe39d base::debug::StackTrace::StackTrace()
#1 0x7f8f13c1051d logging::LogMessage::~LogMessage()
#2 0x7f8f17499cef content::(anonymous namespace)::GLibLogHandler()
#3 0x7f8f11274f61 g_logv
#4 0x7f8f11275172 g_log
#5 0x7f8f05095d2a <unknown>
#6 0x7f8f05096087 <unknown>
#7 0x7f8f1126dd13 g_main_context_dispatch
#8 0x7f8f1126e060 <unknown>
#9 0x7f8f1126e45a g_main_loop_run
#10 0x7f8f0509598b <unknown>
#11 0x7f8f1128f9b5 <unknown>
#12 0x7f8f0d624e9a start_thread
#13 0x7f8f0b7d93fd clone
Aborted (core dumped)
:~/project2/src$ [0616/152448:ERROR:nacl_helper_linux.cc(277)] NaCl helper process running without a sandbox!
Most likely you need to configure your SUID sandbox correctly
steps i've tried to fix the problem:
went to https://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment
read it
built chrome with chrome_sandbox again
ninja -C out/Debug chrome chrome_sandbox
executed build/update-linux-sandbox.sh again
checked again if ~/.bashrc have below line
export CHROME_DEVEL_SANDBOX=/usr/local/sbin/chrome-devel-sandbox
what i would like to know:
What should I do to execute Chrome on above situation?
What would be the reason that --no-sandbox option did not work?
any input would be highly appreciated.
Young.
This error message...
The setuid sandbox provides API version 1, but you need 0
...implies that your setuid binary is out of date hence the program was unable to initiate/spawn a new Browsing Context i.e. Chrome Browser session.
As per the documentation in Linux SUID Sandbox Development google-chrome needs a SUID helper binary to turn on the sandbox on Linux. In majority of the cases you can install the proper sandbox for you using the command:
build/update-linux-sandbox.sh
This program will install the proper sandbox for you in /usr/local/sbin and tell you to update your .bashrc if required.
However, there can be some exceptions as an example, if your setuid binary is out of date, you will get messages such as:
The setuid sandbox provides API version X, but you need Y
You are using a wrong version of the setuid binary!
In these cases, you need to follow the steps below:
Build chrome_sandbox whenever you build chrome (ninja -C xxx chrome chrome_sandbox instead of ninja -C xxx chrome)
After building, execute update-linux-sandbox.sh.
# needed if you build on NFS!
sudo cp out/Debug/chrome_sandbox /usr/local/sbin/chrome-devel-sandbox
sudo chown root:root /usr/local/sbin/chrome-devel-sandbox
sudo chmod 4755 /usr/local/sbin/chrome-devel-sandbox
Finally, you have to include the following line in your ~/.bashrc (or .zshenv):
export CHROME_DEVEL_SANDBOX=/usr/local/sbin/chrome-devel-sandbox
Reference
You can find the documentations in:
Issue 369100: ERROR:nacl_helper_linux.cc(233) NaCl helper process running without a sandbox!
Issue 318646: Chrome won't start after update to latest stable version
Issue 598454: Stop checking for the setuid sanbox binary on desktop Linux
tl; dr
Linux SUID Sandbox
I had a similar issue and when i run chrome with this flag it worked fine
--disable-setuid-sandbox