Open inancgumus opened 3 weeks ago
This could be linked to https://github.com/grafana/xk6-browser/issues/1056. clickablePoint
works with cdppage.GetLayoutMetrics
which is the same CDP request performed before the NPD in this issue.
The first argument in the stack trace (0xc017fa5ee0
) is the receiver, which is a pointer to the screenshotter instance, so viewport is not nil
since it is 0xc017fa5cd8
, but doc is nil
which matches the call from github.com/grafana/xk6-browser@v1.9.1/common/screenshotter.go:398
. So my hypothesis is likely to be correct -- avoid working with cdppage.GetLayoutMetrics, and no more NPDs.
What?
The screenshotter fails when called in a
catch
block (after an exception).Exception:
Test Run ID: 3439289
Why?
Users should take screenshots even after an exception to see the issues in their web pages or scripts.
How?
Looking at the code:
screenshotPage
callsscreenshotter.screenshot
with a non-nil viewport*Rect
.Width: viewport.Width / visualViewport.Scale
.Since
viewport
should not be nil,visualViewport
might be.However, the signature in the panic log says that
viewport
isnil
:According to the code, the
screenshotter.go:398
seems not to pass anil
Rect
, and always passes a non-nil one (here and here) unless there's an error.Tasks
Related PR(s)/Issue(s)
No response