ClientFunction not working for returning large object/array
See original GitHub issueAre you requesting a feature or reporting a bug?
Bug
What is the current behavior?
TestCafe keeps waiting at ClientFunction when returning object/array which is very large for following code.
const getFirstGridTotalRows = ClientFunction(() => {
return window.gridRef[0].filteredRows();
});
const gridData = await getFirstGridTotalRows();
gridData is expected to have around 99k objects in an array. But while running tests, tests are not going forward. It is not even throwing any error. it just waits.
What is the expected behavior?
Should either throw error of memory limit or return the data.
How would you reproduce the current behavior (if this is a bug)?
Take any very large dataset and return it from application url through ClientFunction.
Provide the test code and the tested page URL (if applicable)
Tested page URL:
Test code
const getFirstGridTotalRows = ClientFunction(() => {
return window.gridRef[0].filteredRows();
});
const gridData = await getFirstGridTotalRows();
Specify your
- operating system: Windows 7
- testcafe version: 0.11.1
- node.js version: 6.9.1
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
ClientFunction: _axios2 is not defined - Stack Overflow
I'm running TestCafe for UI automation, using ClientFunctions to trigger API requests (so that I can pass along session cookies).
Read more >ClientFunction Object | Test API | API | Docs - TestCafe
A client function that can return any serializable value from the client side. Use the ClientFunction constructor to create a client function.
Read more >ES5 to ESNext — here's every feature added to JavaScript ...
fullName() will not work, and will return the string "undefined ... Just like any value (object, array, string, number) can be used as...
Read more >HandCrank: Hybrid Partial Evaluation for JavaScript
This problem can be solved with the help of partial evaluation. A partial evaluator can combine a program written in a DSL with...
Read more >Index of the Clojure API
A. *agent* var clojure The agent currently running an action on this thre... *alias-map* dynamic var tools.reader Map from ns alias to ns,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I was able to reproduce the issue. The cause of the problem is that browser runs out of memory when we try to serialize enormously large object. I guess the best option here will be a limit for the returned object size, let’s just throw an error with some descriptive message.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs or feature requests. For TestCafe API, usage and configuration inquiries, we recommend asking them on StackOverflow.