Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not compute content quads error is displayed sometimes when working with exists(0,0) #2615

Open
gokultw opened this issue Jul 13, 2022 · 3 comments

Comments

@gokultw
Copy link

gokultw commented Jul 13, 2022

Describe the bug
Could not compute content quads error is displayed sometimes when working with exists(0,0)

To Reproduce
Below code some time throwing error Could not compute content quads

await text("SOME_TEXT").exists(0,0);

Logs

Error: Could not compute content quads.
    at node_modules/chrome-remote-interface/lib/chrome.js:94:35
    at Chrome._handleMessage (node_modules/chrome-remote-interface/lib/chrome.js:257:17)
    at WebSocket.<anonymous> (node_modules/chrome-remote-interface/lib/chrome.js:235:22)
    at WebSocket.emit (node:events:527:28)
    at Receiver.receiverOnMessage (node_modules/ws/lib/websocket.js:1059:20)
    at Receiver.emit (node:events:527:28)
    at Receiver.dataMessage (node_modules/ws/lib/receiver.js:517:14)
    at node_modules/ws/lib/receiver.js:468:23
    at node_modules/ws/lib/permessage-deflate.js:308:9
    at node_modules/ws/lib/permessage-deflate.js:391:7
    at afterWrite (node:internal/streams/writable:497:5)
    at onwrite (node:internal/streams/writable:477:7)
    at Zlib.cb (node:internal/streams/transform:202:7)
    at Zlib.processCallback (node:zlib:611:8)

Expected behavior
Exists(0,0) should return true or false based on element existence.

Taiko: 1.4.3
OS: MAC Os 12.4
Node.js: v14.19.1
Gauge version: 1.4.3

@gokultw
Copy link
Author

gokultw commented Jul 26, 2022

got this error for .text() method as well.

@mschaaf
Copy link

mschaaf commented Nov 14, 2022

We run into the same error and I applied a small change to taiko/lib/handlers/domHandler.js that allows the test suite to finish.
We changed the getBoxModel function so that it returns default coordinates.

async function getBoxModel(e) {
  try {
  let result = await dom.getContentQuads({
    objectId: isElement(e) ? e.objectId : e,
  });
  return { model: { border: result.quads[0] } };
  } catch (e) {
    return {model: { border: [0,0, 0,0, 0,0, 0,0]}};
  }
}

I don't know why it happens and for what object and whether it is a bad idea to solve it like this or not. But I can tell that it solves the issue for us.

@gokultw
Copy link
Author

gokultw commented Nov 15, 2022

@saikrishna321, could you please help here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants