You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm in the progress of migrating some tests to remove uses of the deprecated ElementHandles. Something I've noticed is the following code. Running Evaluate on a Locator times out (except for the rare occasion). Running an Evaluate on an ElementHandle executes immediately.
Can someone help me understand what's going on here and the proper way to call Evaluate on Locators? Sample code below.
// cell is a playwright.LocatorcellHandle, err:=cell.ElementHandle()
iferr!=nil {
returnnil, fmt.Errorf("could not get cell handle: %w", err)
}
// runs immediately and succeedshandleTagName, err:=cellHandle.Evaluate(`e => e.tagName`)
iferr!=nil {
returnnil, fmt.Errorf("could not get tag: %w", err)
}
// times outlocatorTagName, err:=cell.Evaluate(`e => e.tagName`, nil)
iferr!=nil {
returnnil, fmt.Errorf("could not get tag: %w", err)
}
The text was updated successfully, but these errors were encountered:
In my case, I'm calling cell.ElementHandle() and the cellHandle.Evaluate(...) functions right next to eachother, just like my example.
Given that cell is the Locator and has to resolve to the ElementHandle, I expected removing that step and calling Evaluate directly on the Locator would resolve the same way, does that sound correct? Or does the Locator cache the ElementHandle?
Hello,
I'm in the progress of migrating some tests to remove uses of the deprecated ElementHandles. Something I've noticed is the following code. Running
Evaluate
on aLocator
times out (except for the rare occasion). Running anEvaluate
on anElementHandle
executes immediately.Can someone help me understand what's going on here and the proper way to call Evaluate on Locators? Sample code below.
The text was updated successfully, but these errors were encountered: