karma-runner / karma-browserstack-launcher Goto Github PK
View Code? Open in Web Editor NEWA Karma plugin. Launch any browser on BrowserStack!
License: MIT License
A Karma plugin. Launch any browser on BrowserStack!
License: MIT License
npm WARN peerDependencies The peer dependency karma@>=0.9 included from karma-browserstack-launcher will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
\
blocks: angular/angular#5767
-> 404
Sometimes the worker manager carries on polling for updates after all tests have exited.
I did a little digging and confirmed that it was the setTimeout
/ http requests that were keeping the process alive because of a race condition in the code to stop polling.
I didn't have time to create a PR but I added some logging statements at the following places:
A: Shutting down the tunnel
here
B: 'workerManager.isPolling', workerManager.isPolling
here
C: Started polling
here
D: gotWorkers
here
E: 'this._pollHandle', this._pollHandle
as the first line in this method
F: Stopping polling
inside this block
And this is the trace when I see the worker manager fail to stop polling:
A: Shutting down the tunnel.
C: Started polling
B: workerManager.isPolling true
E: this._pollHandle { _called: true,
_idleTimeout: 1000,
_idlePrev: null,
_idleNext: null,
_idleStart: 24300,
_onTimeout: [Function],
_repeat: null
}
F: Stopping Polling
D: gotWorkers
C: Started polling
D: gotWorkers
C: Started polling
D: gotWorkers
I'll try to figure it out and come up with a PR, but for now I've just added process.nextTick(function() { process.exit(0); });
to my code to work around this.
When karma retries after a disconnect has occurred, it starts a session with url as undefined?id=<id>
, causing the session to timeout.
Looking at lib/launchers/base.js and the restart()
method, I'm guessing we need to store the URL since we don't implement restart()
.
Been evaluating BrowserStack with Karma, but sadly I can not get any tests to run on the system.
BrowserStack appears to not properly connect to the browser, I would think the localTunnel feature is not working correctly.
INFO [karma]: Karma v0.12.31 server started at http://localhost:9876/
DEBUG [launcher.browserstack]: Establishing the tunnel on localhost:9876
INFO [launcher]: Starting browser ie 11 (WINDOWS 8.1) on BrowserStack
INFO [launcher]: Starting browser ie 10 (WINDOWS 8) on BrowserStack
DEBUG [launcher.browserstack]: Tunnel established.
DEBUG [launcher.browserstack]: ie 10 (WINDOWS 8) job queued with id 24519736.
DEBUG [launcher.browserstack]: ie 11 (WINDOWS 8.1) job queued with id 24519737.
INFO [launcher.browserstack]: ie 10 (WINDOWS 8) session at http://www.browserstack.com/automate/builds/ae6a21d5f4b13b1337e8c87839e0d394b80368fe/sessions/5e04d90574a37f0a88012155ba15d0370303a542
DEBUG [launcher.browserstack]: ie 10 (WINDOWS 8) job with id 24519736 still in queue.
INFO [launcher.browserstack]: ie 11 (WINDOWS 8.1) session at http://www.browserstack.com/automate/builds/ae6a21d5f4b13b1337e8c87839e0d394b80368fe/sessions/b07e8061bf29fec5ed7d5c5ba1857ad31d473ed2
DEBUG [launcher.browserstack]: ie 11 (WINDOWS 8.1) job with id 24519737 still in queue.
DEBUG [launcher.browserstack]: ie 10 (WINDOWS 8) job started with id 24519736
DEBUG [launcher.browserstack]: ie 11 (WINDOWS 8.1) job with id 24519737 still in queue.
DEBUG [launcher.browserstack]: ie 11 (WINDOWS 8.1) job started with id 24519737
WARN [launcher.browserstack]: ie 10 (WINDOWS 8) has not captured in 120000 ms, killing.
DEBUG [launcher.browserstack]: Killing ie 10 (WINDOWS 8) (worker 24519736).
DEBUG [launcher.browserstack]: ie 10 (WINDOWS 8) (worker 24519736) successfully killed.
WARN [launcher.browserstack]: ie 11 (WINDOWS 8.1) has not captured in 120000 ms, killing.
DEBUG [launcher.browserstack]: Killing ie 11 (WINDOWS 8.1) (worker 24519737).
DEBUG [launcher.browserstack]: ie 10 (WINDOWS 8) job queued with id 24519890.
DEBUG [launcher.browserstack]: ie 11 (WINDOWS 8.1) (worker 24519737) successfully killed.
INFO [launcher.browserstack]: ie 10 (WINDOWS 8) session at http://www.browserstack.com/automate/builds/ae6a21d5f4b13b1337e8c87839e0d394b80368fe/sessions/c959ec04e0202e45cb090ec60b6f572b918c4e64
DEBUG [launcher.browserstack]: ie 10 (WINDOWS 8) job with id 24519890 still in queue.
DEBUG [launcher.browserstack]: ie 11 (WINDOWS 8.1) job queued with id 24519906.
DEBUG [launcher.browserstack]: ie 10 (WINDOWS 8) job started with id 24519890
INFO [launcher.browserstack]: ie 11 (WINDOWS 8.1) session at http://www.browserstack.com/automate/builds/ae6a21d5f4b13b1337e8c87839e0d394b80368fe/sessions/e4019e7783fcd38fd5c9dc929f9b35f5c484c1ae
DEBUG [launcher.browserstack]: ie 11 (WINDOWS 8.1) job with id 24519906 still in queue.
DEBUG [launcher.browserstack]: ie 11 (WINDOWS 8.1) job started with id 24519906
BrowserStack support recommended the following configs. Seems to fix my issue, feel free to close if this seems unrelated to this plugin:
captureTimeout: 3e5,
browserNoActivityTimeout: 3e5,
browserDisconnectTimeout: 3e5,
browserDisconnectTolerance: 3
This may not be an issue with this plugin, and I've submitted a BrowserStack support request, but I thought I would cover my bases and submit the issue here as well.
Recently, we started having disconnection on iPhone tests typically after a specific number of tests "50 out of 201". I'm not sure if there is a setting in karma-browserstack-launcher
that could help avoid disconnection?
From this video it looks as if the tests are completing successfully but still getting a "disconnection" which makes me think there is some sort of problem of communication between this plugin and BrowserStack http://cl.ly/1v0x1b2u1A3l
//****BS CONFIG****
{ username: 'xxxxx',
accessKey: 'xxx',
localIdentifier: 'bleepbloop',
project: 'v1.0.7 [local:integration]',
build: 'donate-frontend',
name: 'firefox, ie, chrome, safari, iPhone 6 Plus, Samsung Galaxy S5',
tunnelIdentifier: 'bleepbloop' }
//****BS RUN CONFIG****
{ key: 'xxx',
localIdentifier: 'bleepbloop',
jarFile: undefined,
hosts: [ { name: 'localhost', port: 9876, sslFlag: 0 } ],
proxyHost: null,
proxyPort: null,
proxyUser: null,
proxyPass: null }
//***SETTINGS PASSED TO WORKER ****
{ os: 'OS X',
os_version: 'El Capitan',
device: undefined,
browser: 'firefox',
tunnelIdentifier: 'bleepbloop',
browser_version: '43.0',
url: 'http://localhost:9876/?id=65511367',
'browserstack.tunnel': true,
timeout: 300,
project: 'v1.0.7 [local:integration]',
name: 'firefox, ie, chrome, safari, iPhone 6 Plus, Samsung Galaxy S5',
build: 'donate-frontend' }
***SETTINGS**** { os: 'Windows',
os_version: '7',
device: undefined,
browser: 'ie',
tunnelIdentifier: 'bleepbloop',
browser_version: '11.0',
url: 'http://localhost:9876/?id=61845585',
'browserstack.tunnel': true,
timeout: 300,
project: 'v1.0.7 [local:integration]',
name: 'firefox, ie, chrome, safari, iPhone 6 Plus, Samsung Galaxy S5',
build: 'donate-frontend' }
***SETTINGS**** { os: 'WINDOWS',
os_version: '8.1',
device: undefined,
browser: 'chrome',
tunnelIdentifier: 'bleepbloop',
browser_version: '46.0',
url: 'http://localhost:9876/?id=90547240',
'browserstack.tunnel': true,
timeout: 300,
project: 'v1.0.7 [local:integration]',
name: 'firefox, ie, chrome, safari, iPhone 6 Plus, Samsung Galaxy S5',
build: 'donate-frontend' }
***SETTINGS**** { os: 'OS X',
os_version: 'El Capitan',
device: undefined,
browser: 'safari',
tunnelIdentifier: 'bleepbloop',
browser_version: '9.0',
url: 'http://localhost:9876/?id=82673358',
'browserstack.tunnel': true,
timeout: 300,
project: 'v1.0.7 [local:integration]',
name: 'firefox, ie, chrome, safari, iPhone 6 Plus, Samsung Galaxy S5',
build: 'donate-frontend' }
***SETTINGS**** { os: 'ios',
os_version: '8.3',
device: 'iPhone 6 Plus',
browser: undefined,
tunnelIdentifier: 'bleepbloop',
browser_version: 'latest',
url: 'http://localhost:9876/?id=3218706',
'browserstack.tunnel': true,
timeout: 300,
project: 'v1.0.7 [local:integration]',
name: 'firefox, ie, chrome, safari, iPhone 6 Plus, Samsung Galaxy S5',
build: 'donate-frontend' }
***SETTINGS**** { os: 'android',
os_version: '4.4',
device: 'Samsung Galaxy S5',
browser: undefined,
tunnelIdentifier: 'bleepbloop',
browser_version: 'latest',
url: 'http://localhost:9876/?id=44703457',
'browserstack.tunnel': true,
timeout: 300,
project: 'v1.0.7 [local:integration]',
name: 'firefox, ie, chrome, safari, iPhone 6 Plus, Samsung Galaxy S5',
build: 'donate-frontend' }
Typically the test disconnects after running 50 out of 201 tests
Hi. karma-browserstack-launcher
is currently #25
in my list of modules that would likely be broken when nodejs/node#6413 lands (which is anticipated to happen before v7.0).
Note that graceful-fs@1
and graceful-fs@4
are ok and would not be broken by this, but a require()
on graceful-fs@2
or graceful-fs@3
would cause an error soon.
That is, runtime warning fs: re-evaluating native module sources is not supported.
would be turned into a throw.
If you or your deps use graceful-fs@2
or graceful-fs@3
in runtime — you are affected.
Tracking: nodejs/node#5213.
Refs: pghalliday/node-BrowserStackTunnel#26
I'm experiencing the following error (as of version v0.1.7):
TypeError: Cannot read property 'pollingTimeout' of undefined
at createBrowserStackClient (.../index.js:91:30)
This indicates that config.browserStack
might be undefined
hence there should be a check before:
index.js:91 . Just as here: index.js:131 .
08 11 2015 14:18:56.615:ERROR [launcher]: [TypeError: browser.on is not a function]
TypeError: browser.on is not a function
at /home/rgibson/Projects/sizzle/node_modules/karma/lib/launcher.js:94:17
at next (/home/rgibson/Projects/sizzle/node_modules/karma/node_modules/batch/index.js:118:7)
at Batch.end (/home/rgibson/Projects/sizzle/node_modules/karma/node_modules/batch/index.js:154:5)
at launch (/home/rgibson/Projects/sizzle/node_modules/karma/lib/launcher.js:110:11)
at invoke (/home/rgibson/Projects/sizzle/node_modules/karma/node_modules/di/lib/injector.js:75:15)
at Server.<anonymous> (/home/rgibson/Projects/sizzle/node_modules/karma/lib/server.js:170:24)
at Server.g (events.js:260:16)
at emitNone (events.js:67:13)
at Server.emit (events.js:166:7)
at emitListeningNT (net.js:1260:10)
at doNTCallback1 (node.js:428:9)
at process._tickCallback (node.js:350:17)
I think this should be getting on
from BaseLauncher like karma-sauce-launcher (rather than a self.on = emitter.on
kludge), but baseLauncherDecorator
is not a drop-in change because this plugin provides a kill
that is signature-incompatible with BaseLauncher kill
& forceKill
.
There are three of per browser options: browser
, version
, os
, how can I specify os version?
Thank you.
there should be no error
12 12 2016 19:42:15.160:ERROR [reporter.browserlabs]: ? Could not update BrowserStack status
after run karma start karma.conf.js
For the each one of the following browsers
/* karma.conf.js */
customLaunchers: {
bs_ie11_windows: {
base: 'BrowserStack',
browser: 'ie',
browser_version: '11',
os: 'Windows',
os_version: '7'
},
bs_edge_windows: {
base: 'BrowserStack',
browser: 'edge',
browser_version: 'latest',
os: 'Windows',
os_version: '10'
},
bs_safari_latest: {
base: 'BrowserStack',
browser: 'safari',
browser_version: 'latest',
os: 'OS X',
os_version: 'El Capitan'
}
}
I receive the following output
"C:\Program Files (x86)\JetBrains\PhpStorm 10.0.2\bin\runnerw.exe" "C:\Program Files\nodejs\node.exe" C:\Users\luisalbertolg\AppData\Roaming\npm\node_modules\grunt-cli\bin\grunt --gruntfile C:\xxxxxx\Gruntfile.js karma:browserStack
Running "karma:browserStack" (karma) task
03 01 2016 13:28:39.474:INFO [karma]: Karma v0.13.16 server started at http://localhost:9876/
03 01 2016 13:28:39.493:INFO [launcher]: Starting browser safari latest (OS X El Capitan) on BrowserStack
03 01 2016 13:28:44.370:INFO [launcher.browserstack]: safari latest (OS X El Capitan) session at https://www.browserstack.com/automate/builds/xxxx/sessions/xxxx
03 01 2016 13:28:48.339:INFO [Safari 9.0.0 (Mac OS X 10.11.0)]: Connected on socket xxxxx with id xxxxx
Safari 9.0.0 (Mac OS X 10.11.0): Executed 0 of 60 SUCCESS (0 secs / 0 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 1 of 60 SUCCESS (0 secs / 0.006 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 2 of 60 SUCCESS (0 secs / 0.009 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 3 of 60 SUCCESS (0 secs / 0.01 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 4 of 60 SUCCESS (0 secs / 0.012 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 5 of 60 SUCCESS (0 secs / 0.017 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 6 of 60 SUCCESS (0 secs / 0.019 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 7 of 60 SUCCESS (0 secs / 0.02 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 8 of 60 SUCCESS (0 secs / 0.021 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 9 of 60 SUCCESS (0 secs / 0.022 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 10 of 60 SUCCESS (0 secs / 0.023 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 11 of 60 SUCCESS (0 secs / 0.024 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 12 of 60 SUCCESS (0 secs / 0.235 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 13 of 60 SUCCESS (0 secs / 0.236 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 14 of 60 SUCCESS (0 secs / 0.236 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 15 of 60 SUCCESS (0 secs / 0.237 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 16 of 60 SUCCESS (0 secs / 0.238 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 17 of 60 SUCCESS (0 secs / 0.239 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 18 of 60 SUCCESS (0 secs / 0.241 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 19 of 60 SUCCESS (0 secs / 0.242 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 20 of 60 SUCCESS (0 secs / 0.243 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 21 of 60 SUCCESS (0 secs / 0.243 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 22 of 60 SUCCESS (0 secs / 0.243 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 23 of 60 SUCCESS (0 secs / 0.244 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 24 of 60 SUCCESS (0 secs / 0.246 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 25 of 60 SUCCESS (0 secs / 0.247 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 26 of 60 SUCCESS (0 secs / 0.248 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 27 of 60 SUCCESS (0 secs / 0.257 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 28 of 60 SUCCESS (0 secs / 0.258 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 29 of 60 SUCCESS (0 secs / 0.258 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 30 of 60 SUCCESS (0 secs / 0.261 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 31 of 60 SUCCESS (0 secs / 0.35 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 32 of 60 SUCCESS (0 secs / 0.368 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 33 of 60 SUCCESS (0 secs / 0.371 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 34 of 60 SUCCESS (0 secs / 0.375 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 35 of 60 SUCCESS (0 secs / 0.379 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 36 of 60 SUCCESS (0 secs / 0.428 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 37 of 60 SUCCESS (0 secs / 0.509 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 38 of 60 SUCCESS (0 secs / 0.537 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 39 of 60 SUCCESS (0 secs / 0.559 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 40 of 60 SUCCESS (0 secs / 0.575 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 41 of 60 SUCCESS (0 secs / 0.587 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 42 of 60 SUCCESS (0 secs / 0.591 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 43 of 60 SUCCESS (0 secs / 0.598 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 44 of 60 SUCCESS (0 secs / 0.6 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 45 of 60 SUCCESS (0 secs / 0.601 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 46 of 60 SUCCESS (0 secs / 0.618 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 47 of 60 SUCCESS (0 secs / 0.623 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 48 of 60 SUCCESS (0 secs / 0.627 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 49 of 60 SUCCESS (0 secs / 0.64 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 50 of 60 SUCCESS (0 secs / 0.661 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 51 of 60 SUCCESS (0 secs / 0.698 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 52 of 60 SUCCESS (0 secs / 0.787 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 53 of 60 SUCCESS (0 secs / 0.792 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 54 of 60 SUCCESS (0 secs / 0.802 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 55 of 60 SUCCESS (0 secs / 0.83 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 56 of 60 SUCCESS (0 secs / 0.837 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 57 of 60 SUCCESS (0 secs / 0.845 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 58 of 60 SUCCESS (0 secs / 0.865 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 59 of 60 SUCCESS (0 secs / 0.873 secs)
.Safari 9.0.0 (Mac OS X 10.11.0): Executed 60 of 60 SUCCESS (0 secs / 0.891 secs)
Safari 9.0.0 (Mac OS X 10.11.0): Executed 60 of 60 SUCCESS (1.283 secs / 0.891 secs)
Safari 9.0.0 (Mac OS X 10.11.0): Executed 60 of 60 SUCCESS (1.283 secs / 0.891 secs)
Fatal error: Wrong length!
Execution Time (2016-01-03 12:28:38 UTC)
karma:browserStack 11.9s ██████████████████████████████████████████ 100%
Total 11.9s
Process finished with exit code 3
And the session keep open on browserstack until timeout reach.
ea4ec78 broke passing most arguments to BrowserstackLocal
. Only key
is being passed in now.
I am providing the correct credentials and I'm sure of it since I'm able to use it to load up https://api.browserstack.com/automate/browsers.json
; but recently I've been getting this error.
14 01 2019 15:13:29.019:INFO [launcher]: Starting browser chrome 71.0 (OS X High Sierra) on BrowserStack
Error: HTTP Basic: Access denied.
at IncomingMessage.<anonymous> (~/project/node_modules/browserstack/lib/client.js:1:1)
at emitNone (events.js:1:1)
at IncomingMessage.emit (events.js:1:1)
at endReadableNT (_stream_readable.js:1:1)
at _combinedTickCallback (internal/process/next_tick.js:1:1)
at process._tickCallback (internal/process/next_tick.js:1:1)
14 01 2019 15:13:30.968:ERROR [launcher.browserstack]: Can not establish the tunnel.
Error: child failed to start:
BrowserStackLocal v7.4
*** Error: You provided an invalid key
To test an internal server, run:
./BrowserStackLocal --key <KEY>
Example:
./BrowserStackLocal --key DsVSdoJPBi2z44sbGFx1
To test HTML files, run:
./BrowserStackLocal --key <KEY> --folder <full path to local folder>
Example:
./BrowserStackLocal --key DsVSdoJPBi2z44sbGFx1 --folder /Applications/MAMP/htdocs/example/
When I run my specs, I receive the following error
BrowserStackTunnel: binary not present
Sorry if it is a stupid doubt, but I'm confused how proceed
BrowserStack implemented rate limiting for their API, currently 120 requests/min. The 1s pollingTimeout, combined with other requests, makes it likely to quickly hit that limit.
browserstack-runner has a default polling interval of 2 seconds.
should just remain the status
12 12 2016 20:01:14.476:INFO [karma]: Karma v1.3.0 server started at http://localhost:9876/
12 12 2016 20:01:14.476:INFO [launcher]: Launching browser android with unlimited concurrency
12 12 2016 20:01:14.478:DEBUG [launcher.browserstack]: Establishing the tunnel on localhost:9876
12 12 2016 20:01:14.501:INFO [launcher]: Starting browser Android Browser (android 5.0) on BrowserStack
12 12 2016 20:01:22.389:DEBUG [launcher.browserstack]: Tunnel established.
12 12 2016 20:01:30.311:INFO [launcher.browserstack]: Android Browser (android 5.0) session at https://www.browserstack.com/automate/builds/{build}/sess
ions/{session}
12 12 2016 20:01:30.312:DEBUG [launcher.browserstack]: Android Browser (android 5.0) job with id 67855688 in queue.
12 12 2016 20:01:38.455:DEBUG [launcher.browserstack]: Android Browser (android 5.0) job started with id 67855688
12 12 2016 20:02:38.453:WARN [launcher.browserstack]: Android Browser (android 5.0) has not captured in 60000 ms, killing.
12 12 2016 20:02:38.454:DEBUG [launcher.browserstack]: Killing Android Browser (android 5.0) (worker 67855688).
12 12 2016 20:03:07.565:DEBUG [launcher.browserstack]: Android Browser (android 5.0) (worker 67855688) successfully killed.
12 12 2016 20:03:07.568:DEBUG [launcher]: Finished all browsers
12 12 2016 20:03:10.317:INFO [launcher.browserstack]: Android Browser (android 5.0) session at https://www.browserstack.com/automate/builds/{build}/sessions/{session}
12 12 2016 20:03:10.319:DEBUG [launcher.browserstack]: Android Browser (android 5.0) job with id 67855817 in queue.
12 12 2016 20:03:15.505:DEBUG [launcher.browserstack]: Android Browser (android 5.0) job started with id 67855817
12 12 2016 20:04:15.501:WARN [launcher.browserstack]: Android Browser (android 5.0) has not captured in 60000 ms, killing.
12 12 2016 20:04:15.502:DEBUG [launcher.browserstack]: Killing Android Browser (android 5.0) (worker 67855817).
12 12 2016 20:04:42.706:DEBUG [launcher.browserstack]: Android Browser (android 5.0) (worker 67855817) successfully killed.
12 12 2016 20:04:46.925:INFO [launcher.browserstack]: Android Browser (android 5.0) session at https://www.browserstack.com/automate/builds/{build}/sessions/{session}
12 12 2016 20:04:46.925:DEBUG [launcher.browserstack]: Android Browser (android 5.0) job with id 67855877 in queue.
12 12 2016 20:04:49.561:DEBUG [launcher.browserstack]: Android Browser (android 5.0) job started with id 67855877
12 12 2016 20:05:49.558:WARN [launcher.browserstack]: Android Browser (android 5.0) has not captured in 60000 ms, killing.
12 12 2016 20:05:49.558:DEBUG [launcher.browserstack]: Killing Android Browser (android 5.0) (worker 67855877).
12 12 2016 20:06:16.831:DEBUG [launcher.browserstack]: Android Browser (android 5.0) (worker 67855877) successfully killed.
12 12 2016 20:06:19.427:INFO [launcher.browserstack]: Android Browser (android 5.0) session at https://www.browserstack.com/automate/builds/{build}/sessions/{session}
12 12 2016 20:06:19.428:DEBUG [launcher.browserstack]: Android Browser (android 5.0) job with id 67855980 in queue.
12 12 2016 20:06:29.775:DEBUG [launcher.browserstack]: Android Browser (android 5.0) job started with id 67855980
12 12 2016 20:07:29.771:WARN [launcher.browserstack]: Android Browser (android 5.0) has not captured in 60000 ms, killing.
12 12 2016 20:07:29.771:DEBUG [launcher.browserstack]: Killing Android Browser (android 5.0) (worker 67855980).
12 12 2016 20:07:57.265:DEBUG [launcher.browserstack]: Android Browser (android 5.0) (worker 67855980) successfully killed.
karma.config.js
file// to avoid DISCONNECTED messages
browserDisconnectTimeout: 60*1000, // default 2000
browserDisconnectTolerance: 0, // default 0
browserNoActivityTimeout: 60*1000, // default 10000
captureTimeout: 60*1000, // default 60000
customLaunchers: {
android: {
base: 'BrowserStack',
"os": "android",
"os_version": "5.0",
"browser": "Android Browser",
"browser_version": null,
"device": "Google Nexus 9"
}
}
browsers: ['android']
autoWatch: false,
singleRun: false
run karma start karma.conf.js
The relaunch process will repeat 4 times and then exit
I have setup my tests like in your example, when I run them I get:
14 06 2016 00:13:54.529:WARN [launcher]: Can not load "bs_firefox_mac"!
Error: spawn EACCES
and
14 06 2016 00:13:54.530:WARN [launcher]: Can not load "bs_chrome_mac"!
Error: Can not resolve circular dependency! (Resolving: browserStackTunnel -> browserStackTunnel)
What am I doing wrong?
When running tests on multiple browsers (For example 20), browser stack will queue some of the browsers until you will have available vm's (depends on your account).
This makes karma wait forever.
It should be possible to add a config to set how many concurrent browsers will be run in parallel, and wait until they finished before running the next ones.
This makes it impossible to do multiple runs (as it disconnects Karma after a run).
The reason for this was so that Karma does not reconnect browsers from a previous run. Eg. on AngularJS CI server, we run multiple runs (multiple Karma projects). BrowserStack sometimes does not kill the browser fast enough and thus (if using the same port), Karma can recapture old browser which is getting killed and cause "DISCONNECTED" errors.
Short term fix - the what karma-saucelabs-launcher is doing: navigate to about:blank manually (when killing the browser).
Long term, Karma should close it's window when disconnecting.
This PR will address the issue with as few extra changes as possible
#19
Hello,
I have an issue when launching the tests through Browserstack locally.
INFO [karma]: Karma v0.12.16 server started at http://localhost:8080/
INFO [launcher]: Starting browser Chrome 27.0 (OS X 10.6) on BrowserStack
INFO [launcher]: Starting browser Firefox 26.0 (Windows 7) on BrowserStack
INFO [launcher]: Starting browser Safari 6.0 (OS X Lion) on BrowserStack
INFO [launcher]: Starting browser Safari 7.0 (OS X Mavericks) on BrowserStack
INFO [launcher]: Starting browser IE 9.0 (Windows 7) on BrowserStack
INFO [launcher]: Starting browser IE 10 (Windows 8) on BrowserStack
INFO [launcher]: Starting browser IE 11 (Windows 8.1) on BrowserStack
ERROR [launcher.browserstack]: Can not establish the tunnel.
Error: child failed to start:
BrowserStackLocal v2.2
*** Error: Invalid value for host_port param
Although I console.logged the spawn(binary.command, binary.args.concat([options.key]).concat(params))
and all parameters seem good: assembling the command by hand with the content of the logged variables did not trigger the error.
So I wonder where it comes from :-(
Hi,
I think there is a problem with using international characters in browserstack session names:
Capabilities:
chrome_bs: { base: 'BrowserStack', name: "[karma] S20P2 ČNS test 59", 'browser_version': "59", 'browser': "chrome", 'os_version': "7", 'os': "Windows" }
Output:
18 07 2017 10:54:21.746:INFO [reporter.testlab]: run:start
18 07 2017 10:54:22.408:INFO [karma]: Karma v1.7.0 server started at http://0.0.0.0:3002/
18 07 2017 10:54:22.409:INFO [launcher]: Launching browser chrome_bs with unlimited concurrency
18 07 2017 10:54:22.429:INFO [launcher]: Starting browser chrome 59 (Windows 7) on BrowserStack
18 07 2017 10:54:22.886:ERROR [launcher.browserstack]: Can not start chrome 59 (Windows 7)
Error
18 07 2017 10:54:22.887:INFO [reporter.testlab]: run:complete
18 07 2017 10:54:22.888:INFO [reporter.testlab]: exit
All works when removing the international character.
The problem does not occur, when using BrowserStack API directly:
$ curl -u "x:y" https://api.browserstack.com/4/worker -H "Content-Type: application/json" -X POST --data '{"os": "windows", "os_version": 7, "browser": "chrome", "browser_version": "59", "url": "http://xxx", "name": "ČNS test"}'`
{"id":78140297,"url":"http://xxx"}
It would be nice, if this either worked, or there was at least appropriate message that would warn the user of such problems. This has taken us few days to debug. International characters can get into the name, when we let the developers of our projects (who use our CI) name their tests
Thank you,
Jan
v1.1.0 has an incorrect path in it which prevents any Browserstack tests from running.
ERROR [plugin]: Error during loading "myrepo/node_modules/karma-browserstack-launcher" plugin:
Cannot find module './BrowserStackReporter'
The line responsible for this is index.js
, specifically
var BrowserStackReporter = require('./BrowserStackReporter')
which should be
var BrowserStackReporter = require('./browserstack-reporter')
Similar to karma-sauce-reporter, it would be nice if Browserstack sessions with test errors appear red in the Browserstack web UI. At the moment all sessions appear green.
The Browserstack session API could be used to send the session status to Browserstack.
I want to test against the latest stable version of Chrome, so I left off the browser_version
in my config:
customLaunchers: {
bs_chrome: {
base: 'BrowserStack',
browser: 'chrome',
os: 'windows',
os_version: '7'
}
}
This leads to an error:
ERROR [launcher.browserstack]: Can not start chrome (windows 7)
Error: Validation Failed - `browser_version` invalid
The captured
property, relied upon by the _onTimeout
method, is always false as the markCaptured
method is never called.
It seems tags >= v1.4.0 aren't pushed here. Could someone push them?
/CC @johnjbarton
Updating to the browserstack package v 1.1.1 causes a EACCESS error starting from line 144 in browserstackTunnel.js: this.tunnel = spawn(binary.command, binary.args.concat([options.key]).concat(params));
https://github.com/pghalliday/node-BrowserStackTunnel/blob/master/src/BrowserStackTunnel.js#L144
I had to roll back to ~1.0
for browserstack to make the karma-browserstack-launcher
to work
ref: 3527eb6
Currently BowserStack launcher in karma customLaunchers can not set browser flags/prefs like other launchers whose base is 'Chrome' or 'Firefox'. Example of flags: https://github.com/karma-runner/karma-chrome-launcher#configuration
I'm seeing the following error in a travis build with version 1.3.0, any thoughts on what's going on?
12 12 2018 15:41:47.243:ERROR [plugin]: Error during loading "/home/travis/build/tensorflow/tfjs-core/node_modules/karma-browserstack-launcher" plugin:
internalBinding is not defined
12 12 2018 15:41:47.468:ERROR [reporter]: Can not load reporter "BrowserStack", it is not registered!
Perhaps you are missing some plugin?
I get these kind of errors a lot:
WARN [launcher.browserstack]: chrome 39.0 (OS X Yosemite) has not captured in 60000 ms, killing
And to try to circumvent those errors, I've updated the karma-config like this:
browserStack: {
captureTimeout: 240, // default is 120
timeout: 600, // default is 300
retryLimit : 5
},
But the capture timeout, as reflected in the error above, is the same (60000 ms)
I'm just getting started with using Karma & BrowserStack together, and I'm not able to get my tests to run with the default setup. I did the standard npm
install, and added the following config:
browserStack: {
username: '********',
accessKey: '*********'
// startTunnel: false
},
customLaunchers: {
browserstack_safari_mac: {
base: "BrowserStack",
browser: "safari",
browser_version: "8.0",
os: "OS X",
os_version: "Yosemite"
}
},
browsers: [
"browserstack_safari_mac"
]
The first time I ran, it said it couldn't find the BrowserStack binary, so it downloaded it. Sure, fine. But, so long as I leave the startTunnel
line commented out, I get the following error:
INFO [karma]: Karma v0.12.31 server started at http://localhost:9876/
INFO [launcher]: Starting browser safari 8.0 (OS X Yosemite) on BrowserStack
ERROR [launcher.browserstack]: Can not start safari 8.0 (OS X Yosemite)
Error: getaddrinfo ENOTFOUND
If I change the startTunnel
setting and manually run the BrowserStackLocal
app, everything seems to work fine.
If I configured the Travis-CI browserstack addon according to this document, karma-browserstack-launcher will always receive an "access denied" when running in travis-ci.
The reason is that travis-ci will always add a suffix "-travis" to your browserstack username and also set this new username to the process.env.BROWSERSTACK_USERNAME.
https://github.com/travis-ci/travis-build/blob/10491086722c72e8bd73672c76d9e1947c70b3c1/lib/travis/build/addons/browserstack.rb#L182
Then this modified browserstack username is used by karma-browserstack-launcher, according to the code below.
karma-browserstack-launcher/index.js
Line 42 in 22ccf91
The workaround is to set process.env.BROWSERSTACK_USERNAME to your original username at the top of karma.conf.js but I hope this issue can be fixed in karma-browserstack-launcher or at least mentioned in the README/FAQ.
Hi, thanks for your work on this package!
The recently published changes (v1.5) cause the browerstack tests for the mathjs package to fail (for details see josdejong/mathjs#1453 and https://travis-ci.org/josdejong/mathjs/jobs/511546544). I checked both the changlog and releases for this package and there is no mention there about the changes introduced between v1.4 and v1.5.
Would it be possible to share the changes with us to help us to understand why our tests fail with the latest release?
A sample of the errors we are getting:
26 03 2019 15:26:08.417:ERROR [launcher]: Cannot load browser "bs_firefox_android"!
Error: Username is required.
at ApiClient.BaseClient (/home/travis/build/josdejong/mathjs/node_modules/browserstack/lib/client.js:18:9)
at ApiClient.ApiBaseClient (/home/travis/build/josdejong/mathjs/node_modules/browserstack/lib/api.js:9:13)
at new ApiClient (/home/travis/build/josdejong/mathjs/node_modules/browserstack/lib/api.js:162:17)
at Object.createClient (/home/travis/build/josdejong/mathjs/node_modules/browserstack/lib/api.js:278:10)
at createBrowserStackClient (/home/travis/build/josdejong/mathjs/node_modules/karma-browserstack-launcher/index.js:64:20)
at Array.invoke (/home/travis/build/josdejong/mathjs/node_modules/di/lib/injector.js:75:15)
at Injector.get (/home/travis/build/josdejong/mathjs/node_modules/di/lib/injector.js:48:43)
at Injector.get (/home/travis/build/josdejong/mathjs/node_modules/di/lib/injector.js:54:19)
at get (/home/travis/build/josdejong/mathjs/node_modules/di/lib/injector.js:54:19)
at /home/travis/build/josdejong/mathjs/node_modules/di/lib/injector.js:71:14
at Array.map (<anonymous>)
at invoke (/home/travis/build/josdejong/mathjs/node_modules/di/lib/injector.js:70:31)
at Array.instantiate (/home/travis/build/josdejong/mathjs/node_modules/di/lib/injector.js:59:20)
at Injector.get (/home/travis/build/josdejong/mathjs/node_modules/di/lib/injector.js:48:43)
at module.(anonymous function) (/home/travis/build/josdejong/mathjs/node_modules/karma/lib/config.js:249:64)
at Array.invoke (/home/travis/build/josdejong/mathjs/node_modules/di/lib/injector.js:75:15)
26 03 2019 15:26:08.418:ERROR [launcher]: Cannot load browser "bs_firefox_windows"!
Error: Can not resolve circular dependency! (Resolving: browserStackClient -> browserStackClient)
at error (/home/travis/build/josdejong/mathjs/node_modules/di/lib/injector.js:22:12)
at Injector.get (/home/travis/build/josdejong/mathjs/node_modules/di/lib/injector.js:44:15)
at Injector.get (/home/travis/build/josdejong/mathjs/node_modules/di/lib/injector.js:54:19)
at get (/home/travis/build/josdejong/mathjs/node_modules/di/lib/injector.js:54:19)
at /home/travis/build/josdejong/mathjs/node_modules/di/lib/injector.js:71:14
at Array.map (<anonymous>)
at invoke (/home/travis/build/josdejong/mathjs/node_modules/di/lib/injector.js:70:31)
at Array.instantiate (/home/travis/build/josdejong/mathjs/node_modules/di/lib/injector.js:59:20)
at Injector.get (/home/travis/build/josdejong/mathjs/node_modules/di/lib/injector.js:48:43)
at module.(anonymous function) (/home/travis/build/josdejong/mathjs/node_modules/karma/lib/config.js:249:64)
at Array.invoke (/home/travis/build/josdejong/mathjs/node_modules/di/lib/injector.js:75:15)
at Injector.get (/home/travis/build/josdejong/mathjs/node_modules/di/lib/injector.js:48:43)
at /home/travis/build/josdejong/mathjs/node_modules/karma/lib/launcher.js:62:72
at names.forEach (/home/travis/build/josdejong/mathjs/node_modules/karma/lib/launcher.js:102:71)
at Array.forEach (<anonymous>)
at Launcher.launch (/home/travis/build/josdejong/mathjs/node_modules/karma/lib/launcher.js:102:13)
Why does it take so long to stop a browser? From the moment I see
30 06 2016 00:28:51.913:DEBUG [karma]: Run complete, exiting.
30 06 2016 00:28:51.913:DEBUG [launcher]: Disconnecting all browsers
30 06 2016 00:28:51.914:DEBUG [framework.browserify]: cleaning up
30 06 2016 00:28:51.914:DEBUG [launcher.browserstack]: Shutting down the tunnel.
30 06 2016 00:28:52.383:DEBUG [launcher.browserstack]: firefox 47.0 (OS X Yosemite) (worker 58743929) successfully killed.
30 06 2016 00:28:52.383:DEBUG [launcher]: Finished all browsers
to the moment the browser is closed and other one can be started, it takes almost a minute and sometimes longer, during which Karma page will be trying to reconnect (video).
I'm using pretty standard config
// Karma configuration
// Generated on Thu Jun 30 2016 00:00:45 GMT+0100 (BST)
module.exports = function(config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',
// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['browserify', 'mocha'],
// list of files / patterns to load in the browser
files: [
'test/**/*.js',
],
// list of files to exclude
exclude: [
],
// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
'test/**/*.js': [ 'browserify' ]
},
// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['progress'],
// web server port
port: 9876,
// enable / disable colors in the output (reporters and logs)
colors: true,
// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_DEBUG,
// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: false,
// Concurrency level
// how many browser should be started simultaneous
concurrency: Infinity,
browserStack: {
username: '___',
accessKey: '___'
},
customLaunchers: {
bs_firefox_mac: {
base: 'BrowserStack',
browser: 'firefox',
browser_version: '47.0',
os: 'OS X',
os_version: 'Yosemite'
},
},
// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['bs_firefox_mac'],
})
}
karma start --single-run
When running npm audit in my project, I get two warnings related to dependencies of karma-browserstack-launcher
:
┌──────────────────────────────────────────────────────────────────────────────┐
│ Manual Review │
│ Some vulnerabilities require your attention to resolve │
│ │
│ Visit https://go.npm.me/audit-guide for additional guidance │
└──────────────────────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ High │ Denial of Service │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ https-proxy-agent │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in │ >=2.2.0 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ karma-browserstack-launcher [dev] │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ karma-browserstack-launcher > browserstack > │
│ │ https-proxy-agent │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://nodesecurity.io/advisories/593 │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ High │ Denial of Service │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ https-proxy-agent │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in │ >=2.2.0 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ karma-browserstack-launcher [dev] │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ karma-browserstack-launcher > browserstacktunnel-wrapper > │
│ │ https-proxy-agent │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://nodesecurity.io/advisories/593 │
└───────────────┴──────────────────────────────────────────────────────────────┘
Would be great if the vulnerable dependencies can be updated. Thanks!
We’re using Karma + BrowserStack on CircleCI and even though some tests fail, CircleCI seems to always detect a 0 exit status. I have a feeling it gets that successful status from the connection CircleCI <> BrowerStack?
Running suite w/ mocha on 3 browsers.
(left bar should be red)
Must’ve been something that I overlooked.
It seems like there is no longer any active development happening on this project.
The latest commit, merged PR or issue resolution was mid-2017.
This has been a very useful tool in my team's testing pipeline, but there are certain features that I would love to see added to future versions. (the ability to specify a custom timezone being a particularly urgent feature)
I'm also happy to continue maintaining this project :)
When I try to launch automated test with IE8 I get this error message:
INFO [karma]: Karma v0.10.2 server started at http://localhost:9876/
INFO [launcher]: Starting browser IE 8.0 (Windows 7) on BrowserStack
ERROR [launcher.browserstack]: Can not start IE 8.0 (Windows 7) on BrowserStack
Error: Validation Failed - browser
invalid, browser_version
invalid
Here is my customLaunchers config:
bs_ie8: {
base: 'BrowserStack',
browser: 'IE',
browser_version: '8.0',
os: 'Windows',
os_version: '7'
},
bs_firefox: {
base: 'BrowserStack',
browser: 'firefox',
browser_version: '24.0',
os: 'Windows',
os_version: '7'
},
bs_chrome: {
base: 'BrowserStack',
browser: 'chrome',
browser_version: '29.0',
os: 'Windows',
os_version: '7'
}
Everything works fine with Firefox and Chrome
The commit 85c4764 shouldn't have landed in a patch release as it's a breaking change.
The true
default is IMO wrong - BrowserStack doesn't have all devices available as real mobiles so just updating the karma-browserstack-launcher makes a lot of browsers fail.
The default should be changed to false
.
Currently, there's no way to pass enable-logging-for-api
to the BrowserstackBinary. It would be nice if I could.
Hey,
first thank you for the launcher! It works perfect for me. The only thing I am missing is, that it does not support all capabilities that are offered by BrowserStack:
https://www.browserstack.com/automate/capabilities
For example "browserstack.video" or "browserstack.debug". Especially "video" (true/false) would be very nice for me, to disable the video recording. BrowserStack says it would make the tests faster.
Are there any plans to implement it or are PRs desired?
Greets from Germany
Mostly on our end we run karma-browserstack-launcher
via travis ci. When two builds, one for a pull request and one for a branch run at the same time, One of the builds will often timeout. I think the one that starts first times out as soon as the other build starts to run.
On previous versions of karma-browserstack-launcher
this did not happen.
I haven't had time to look into this too much, but it is probably a result of the switch to browserstack-local
Hi,
After looking through the source I am not seeing this option. Is it possible to specify the location of an already downloaded version of the binary?
Hey there!
It'd be awesome if karma-browserstack-launcher
supported a simplified
configuration similar to what karma-sauce-launcher
offers.
I'd suspect the underlying implementation would be similar to browserstack-capabilities.
module.exports = (config) => {
config.set({
customLaunchers: {
Chrome: {
base: 'BrowserStack',
browser: 'chrome',
browser_version: 'latest' // Chrome 73
},
ChromePrior: {
base: 'BrowserStack',
browser: 'chrome',
browser_version: 'latest-1' // Chrome 72
},
Safari: {
base: 'BrowserStack',
browser: 'safari',
browser_version: 'latest' // Safari 12
}
},
browsers: ['Chrome', 'ChromePrior', 'Safari'],
// ...
});
};
This might be a really stupid question, but how to I access the driver/webdriver to make screenshot like suggested here: https://www.browserstack.com/automate/node#enhancements-screenshots
var fs = require('fs');
webdriver.WebDriver.prototype.saveScreenshot = function(filename) {
return driver.takeScreenshot().then(function(data) {
fs.writeFile(filename, data.replace(/^data:image\/png;base64,/,''), 'base64', function(err) {
if(err) throw err;
});
})
};
driver.saveScreenshot('snapshot1.png');
Bonus question: Is it also possible to take screenshots of a css selector, not the whole page?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.