I'm using Playwright, which lacks an equivalent for JavaScript's closest()
function.
Can I accomplish that using XPath?
I'm using Playwright, which lacks an equivalent for JavaScript's closest()
function.
Can I accomplish that using XPath?
Copyright © 2021 Jogjafile Inc.
I'm using the .NET bindings, but you can convert the following to your environment.
I defined extension methods (input validation excluded for brevity):
Which are used like so:
There are some edge cases, but it works for my use case.