From 4bbe74c3cb6b0b0a8a581168d638ae3482ff017b Mon Sep 17 00:00:00 2001 From: Yad Smood Date: Tue, 21 Mar 2023 21:08:47 +0800 Subject: [PATCH] all the actions of an element should use its own context fix #842 --- query.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/query.go b/query.go index c8dc6fa4..1feb30a8 100644 --- a/query.go +++ b/query.go @@ -500,7 +500,7 @@ func (el *Element) ElementX(xPath string) (*Element, error) { // ElementByJS returns the element from the return value of the js func (el *Element) ElementByJS(opts *EvalOptions) (*Element, error) { - e, err := el.page.Sleeper(NotFoundSleeper).ElementByJS(opts.This(el.Object)) + e, err := el.page.Context(el.ctx).Sleeper(NotFoundSleeper).ElementByJS(opts.This(el.Object)) if err != nil { return nil, err }