-
Notifications
You must be signed in to change notification settings - Fork 43
Conversation
The error was: panic: interface conversion: interface {} is nil, not *common.ElementHandle The cause of the error was trying to assert a nil result in Frame.document to *ElementHandle. Of course, this is probably the surface error. There may be other causes for it, or maybe not. It was hard to test Frame, so I used an abstraction called FrameExecutionContext. There are a lot of problems are happening with execution contexts. See: #125 and #49, for example. So, it's better to make them testable, starting here. Fixes #53
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just minor suggestions.
While this fixes the panic, I'm not sure what effects it will functionally have for all callers of Frame.document()
. I guess we'll find out and deal with that if/when it happens.
Have you tested how this behaves with the script in #53?
+ Move frame execution context to frame.go + Remove the unnecessary Errorf in Frame.document + Make the test robust
7b0b22a
to
fd30521
Compare
Thanks 🙏
Sadly, yes, we'll find that out as we improve the tests.
Sure thing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Maybe update the PR description with how it behaves with the script from #53, or comment in the issue itself.
Also, the bug
label is typically only useful on issues, unless your PR also introduces a bug 😛
It behaves like without the error 😄 More like other unsolvable errors we've seen so far. |
The error was:
panic: interface conversion: interface {} is nil, not *common.ElementHandle
The cause of the error was trying to assert a nil result in
Frame.document
to*ElementHandle
. Of course, this is probably the surface error. There may be other causes for it, or maybe not.It was hard to test
Frame
, so I used an abstraction calledFrameExecutionContext
. There are a lot of problems are happening with execution contexts. See: #125 and #49, for example. So, it's better to make them testable, starting here.Fixes #53