The puppeteer closes the page after an error - reactjs

While testing my page, an error is thrown from the dependency. The error is not critical and does not interfere with my application. But when testing with a puppeteer, with this error, he simply closes the tested page. How can I prevent this to continue testing further ignoring this error?
Example:
This error is thrown on the page and the test ends with it.
Error: TypeError: Cannot set property 'paddingLeft' of undefined
at FrozenColumns.layoutRow (webpack-internal:///./node_modules/react-tabulator/node_modules/tabulator-tables/dist/js/tabulator.es2015.js:16595:26)
at Row.initialize (webpack-internal:///./node_modules/react-tabulator/node_modules/tabulator-tables/dist/js/tabulator.es2015.js:5313:37)
at Row.reinitialize (webpack-internal:///./node_modules/react-tabulator/node_modules/tabulator-tables/dist/js/tabulator.es2015.js:5376:8)
at eval (webpack-internal:///./node_modules/react-tabulator/node_modules/tabulator-tables/dist/js/tabulator.es2015.js:4415:7)
at Array.forEach (<anonymous>)
at RowManager.reinitialize (webpack-internal:///./node_modules/react-tabulator/node_modules/tabulator-tables/dist/js/tabulator.es2015.js:4414:12)
at ColumnManager.redraw (webpack-internal:///./node_modules/react-tabulator/node_modules/tabulator-tables/dist/js/tabulator.es2015.js:1206:25)
at RowManager.refreshActiveData (webpack-internal:///./node_modules/react-tabulator/node_modules/tabulator-tables/dist/js/tabulator.es2015.js:3668:31)
at RowManager.sorterRefresh (webpack-internal:///./node_modules/react-tabulator/node_modules/tabulator-tables/dist/js/tabulator.es2015.js:3482:8)
at HTMLDivElement.eval (webpack-internal:///./node_modules/react-tabulator/node_modules/tabulator-tables/dist/js/tabulator.es2015.js:22644:27)
My environment:
Puppeteer version: 5.4.2
Platform / OS version: macOS 10.15.7
Node.js version: v12.16.1

When using jest-puppeteer, you can specify the exitOnPageError: false parameter in jest-puppeteer.config.js. In this case, the test will not complete if there is an error on the page.

Related

Getting an errno: -100, code: 'EPROTO', syscall: 'write', when visiting localhost:3000 on my frontend repository

I haven't touched this repo in a while, and as far as I remember it was running fine before It was sitting dormant for almost a year. I wonder if it something to do with SSL going out of date or needing an update or something, I tried deleting node_modules and re-installing but nothing.
That's the error I am getting, here it is in VS Code terminal:
Error: write EPROTO 140704571122880:error:14094438:SSL routines:ssl3_read_bytes:tlsv1 alert internal error:../deps/openssl/openssl/ssl/record/rec_layer_s3.c:1544:SSL alert number 80
at WriteWrap.onWriteComplete [as oncomplete] (internal/stream_base_commons.js:94:16) {
errno: -100,
code: 'EPROTO',
syscall: 'write',
response: undefined
}
Here is the error in the console of chrome browser:
Uncaught at WriteWrap.onWriteComplete [as oncomplete] (internal/stream_base_commons.js:94:16)
I am not sure what information to give, but I can provide more info if anyone has questions.
Tried to npm run dev and the frontend repo spins up and compiles successfully, but when I visit localhost:3000 it throws an SSL error.
I found out that it was actually one of the API_HOST environment variable that was in my .env file causing this SSL error, when I started running the backend locally and pointed the API_HOST to localhost I got past the above error. Hopefully this helps you in some way.

Node-red write data on file

I have some trouble in use node File in node-red,
I received the following error:
TypeError: this is not a typed array.
at Function.from (native)
at FileNode.<anonymous> (/usr/local/lib/node_modules/node-red/nodes/core/storage/50-file.js:67:39)
at emitOne (events.js:77:13)
at FileNode.emit (events.js:169:7)
at FileNode.Node.receive (/usr/local/lib/node_modules/node-red/red/runtime/nodes/Node.js:215:14)
at InjectNode.Node.send (/usr/local/lib/node_modules/node-red/red/runtime/nodes/Node.js:137:22)
at InjectNode.<anonymous> (/usr/local/lib/node_modules/node-red/nodes/core/core/20-inject.js:77:22)
at emitOne (events.js:77:13)
at InjectNode.emit (events.js:169:7)
at InjectNode.Node.receive (/usr/local/lib/node_modules/node-red/red/runtime/nodes/Node.js:215:14)
I put a picture to show it better.
How I can fix it?
Note:
As asked
Node-RED version: v0.18.4
Node.js version: v4.2.6
The node configuration is here
You are using a quite old version of Node.js. Most likely the root cause of your issue is the same for the one reported here: Getting TypeError: this is not a typed array using Buffer.from in mocha
It is worth to upgrade your Node.js to 6.x.x or newer.
Note: I replicated your flow in my system, running:
Node-RED version: v0.19.1 and Node.js version: v8.11.1
and it works flawlessly.

webdriver-manager error when calling update with "Unhandled 'error' event"

I currently have a project which uses jasmine and selenium on top of node.js. Protractor provides some useful modules which I would like to use, so I installed it and tried to run it using "protractor conf.js". I ended up getting the following errors:
[15:55:03] E/direct - Error code: 135
[15:55:03] E/direct - Error message: Could not find update-config.json. Run 'webdriver-manager update'
to download binaries.
[15:55:03] E/direct - Error: Could not find update-config.json. Run 'webdriver-manager update' to down
load binaries.
When I try to run webdriver-manager update, I get this:
[15:46:10] I/file_manager - creating folder C:\Program Files\node-v8.1.0-win-x86\node_modules\protract
or\node_modules\webdriver-manager\selenium
events.js:182
throw er; // Unhandled 'error' event
I saw some other threads with similar errors but they didn't seem to work for me. I suspect that this might be related to the fact that I want to run protractor without AngularJS, but I'm not sure since I believed it was possible to run protractor without angular. Any help would be appreciated.
EDIT: I tried setting "proxy_on" and "npm config set strict-ssl false" but ended up getting the following when running webdriver-manager-update:
events.js:182 throw er; Unhandled 'error' event
Error: self signed certificate in certificate chain at TLSSocket. (_tls_wrap.js:1098:38) at emitNone (events.js:105:13) at TLSSocket.emit (events.js:207:7) at TLSSocket._finishInit (_tls_wrap.js:628:8) at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:458:38)
Edit 2: Using npm 5.0.3, node 8.1.0, webbdriver-manager 12.0.6, OS: Windows 7

Google Chrome V 57.0 unable to input text when used with Robot Framework & throws error

I am using Robot Framework for test automation.
Recently I upgraded my Chrome browser to the latest version, V 57.0
Since then, I am unable to execute my test scripts on Chrome.
The webpage opens up and navigates until Login page, the cursor focus is set on Username field and then it just keeps on trying for few seconds until i receive an error saying:
[ WARN ] Keyword 'Capture Page Screenshot' could not be run on
failure: WebDriverException: Message: unknown error: cannot get
automation extension from unknown error: page could not be found:
chrome-extension://aapnijgdinlhnhlmodcfapnahmbfebeb/_generated_background_page.html
(Session info: chrome=57.0.2987.133) (Driver info:
chromedriver=2.24.417431
(9aea000394714d2fbb20850021f6204f2256b9cf),platform=Windows NT
10.0.10586 x86_64)
I have no extensions installed in the browser.
Also followed up a similar post here
It just mentions about removing your extensions, which I already did.
Thanks
EDIT: Always make certain you are using current and compatible versions of Chromedriver. I always suspect this when the problems show up at the element level. The driver has to be updated a lot as the browser evolves. In your case, you've indicated a current Chromedriver is a solution. Note that this solution generalizes to all browsers.
If the problem were more related to window sizing/resizing, it might be due to the fact that selenium is trying to use an extension to perform a windowing function. Issues with running headless... This assumes you are running headless.
Solution is likely to rework the test for headless runs, or run else try a real browser.
Your chromedriver is not latest as said in your error message (Driver info: chromedriver=2.24.417431). Latest available chromedriver version is V2.28
Use latest available Chrome Drivers and you will be all good.
Mark +1 if this answer is useful to you.

Webdriver Exception after text is typed using RobotFramework

I'm testing app written with angularjs. When I want to login using 'Input Text' keyword, I get exception:
12:13:13.201 INFO Typing text 'user#123123.com' into text field '//label[contains(#ng-class,'username')]/input[#id='input-username']'
12:13:14.676 FAIL WebDriverException: Message: javascript error: $ is not defined
JavaScript stack:
ReferenceError: $ is not defined
at eval (eval at executeAsyncScript (unknown source), <anonymous>:2:366)
at Browser.self.notifyWhenNoOutstandingRequests (http://localhost:8000/app/bower_components/angular/angular.js:5757:7)
at eval (eval at executeAsyncScript (unknown source), <anonymous>:2:323)
at eval (eval at executeAsyncScript (unknown source), <anonymous>:2:439)
at executeAsyncScript (<anonymous>:329:26)
at apply.ELEMENT (<anonymous>:345:29)
at callFunction (<anonymous>:237:33)
at apply.ELEMENT (<anonymous>:247:23)
at <anonymous>:248:3
(Session info: chrome=52.0.2743.116)
(Driver info: chromedriver=2.22.397933 (1cab651507b88dec79b2b2a22d1943c01833cc1b),platform=Windows NT 10.0.10586 x86_64)
It worked properly sometime ago, but now still fails. Could it be the RF(library) issue or angular?
I've tried to update chromedriver and chrome, as well.
More facts:
1. everything is ok with present configuration on another applications,
2. the same configuration works well on another computers,
3. I can't even run it on Firefox - I get message: WebDriverException: Message: Can't load the profile. Profile Dir: %s If you specified a log_file in the FirefoxBinary constructor, check it for details.
Maybe it could be caused by some system updates (windows 10)? But, like I've mentioned, tests on other application work fine.
Ok, I've found the problem and solve it for time being. Basically I had to back to old version ExtendedSelenium2Library (0.4.13). But I don't know how it impacts for current tests.

Resources