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

SVG element causes DOM.getBoxModel error #1247

Closed
Jamesernator opened this issue Nov 1, 2017 · 7 comments
Closed

SVG element causes DOM.getBoxModel error #1247

Jamesernator opened this issue Nov 1, 2017 · 7 comments

Comments

@Jamesernator
Copy link

I've been having issues trying to hover an svg element using elementHandle.hover(), now using page.evaluate(element => element.getBoundingClientRect(), elementHandle) works so I'm not sure why it throws an error for .hover().

Here's a minimal example that causes it:

puppeteer-svg-hover-test.zip

@Jamesernator
Copy link
Author

I tried the latest version in the repository and now the error has changed to Error: Node is not visible which isn't the case either.

@aslushnikov aslushnikov added the bug label Nov 8, 2017
@aslushnikov
Copy link
Contributor

Thanks @Jamesernator, this is a bug.

@lgrzybowski
Copy link

I have similar problem but related to click on button where page got reloaded because of some AJAX call. I think this can be related as both methods are calling function visibleCenter() I get that stacktrace:

Error: Protocol error (DOM.getBoxModel): Could not compute box model. undefined
        at Session._onMessage (/Users/lukasz/Documents/work/github/brandwatch/analytics-ats/node_modules/puppeteer/lib/Connection.js:205:25)
        at Connection._onMessage (/Users/lukasz/Documents/work/github/brandwatch/analytics-ats/node_modules/puppeteer/lib/Connection.js:105:19)
        at emitOne (events.js:115:13)
        at WebSocket.emit (events.js:210:7)
        at Receiver._receiver.onmessage (/Users/lukasz/Documents/work/github/brandwatch/analytics-ats/node_modules/ws/lib/WebSocket.js:143:47)
        at Receiver.dataMessage (/Users/lukasz/Documents/work/github/brandwatch/analytics-ats/node_modules/ws/lib/Receiver.js:389:14)
        at Receiver.getData (/Users/lukasz/Documents/work/github/brandwatch/analytics-ats/node_modules/ws/lib/Receiver.js:330:12)
        at Receiver.startLoop (/Users/lukasz/Documents/work/github/brandwatch/analytics-ats/node_modules/ws/lib/Receiver.js:165:16)
        at Receiver.add (/Users/lukasz/Documents/work/github/brandwatch/analytics-ats/node_modules/ws/lib/Receiver.js:139:10)
        at Socket._ultron.on (/Users/lukasz/Documents/work/github/brandwatch/analytics-ats/node_modules/ws/lib/WebSocket.js:139:22)
        at emitOne (events.js:115:13)

@clujin
Copy link

clujin commented Nov 21, 2017

I'm not sure if this helps but when I use the chrome-devtools protocol "DOM.getNodeForLocation" on a SVG element, it will return an error. So might this be related?

@trickymast3r
Copy link

Same With Me , Try to click con but DOM.getBoxModel still return undefined, I just test on latest Chrome Browser and got the same result { width: auto, height: auto} . But it still rendered and visible

@aslushnikov
Copy link
Contributor

Filed upstream crbug.com/800636

aslushnikov added a commit to aslushnikov/puppeteer that referenced this issue Jun 26, 2018
aslushnikov added a commit to aslushnikov/puppeteer that referenced this issue Jun 27, 2018
This roll includes:
- https://crrev.com/570566 - DevTools: teach DOM.getBoxModel to work with SVG nodes

Fixes puppeteer#1247.
aslushnikov added a commit to aslushnikov/puppeteer that referenced this issue Jun 28, 2018
This roll includes:
- https://crrev.com/570566 - DevTools: teach DOM.getBoxModel to work with SVG nodes

Fixes puppeteer#1247.
aslushnikov added a commit that referenced this issue Jun 28, 2018
This roll includes:
- https://crrev.com/570566 - DevTools: teach DOM.getBoxModel to work with SVG nodes

Fixes #1247.
@Muzietto
Copy link

Muzietto commented Jun 4, 2019

I solved a problem that looks 99% the same as here in two ways:

  • putting an I.wait(3) between the appearance of the item and the click on it
  • using a I.retry({ times:3, ...}).click(sel) instead of an I.click(...)

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

No branches or pull requests

6 participants