After a full hardware and OS change, Puppeteer-extra no longer recognizes waitForXPath. Despite reinstalling dependencies, it still fails. Revised example:
await browserPage.findElementByXPath('//div[@id="accessArea"]/button');
const btnElements = await browserPage.searchXPath('//div[@id="accessArea"]/button');
await btnElements[0].performClick();
I had a similar issue during a recent project upgrade where Puppeteer-extra seemed to lose support for waitForXPath. I ended up doing some debugging and found that the API evolved and the correct method to use became page.$x. I switched my code to use page.$x and managed to get it working reliably with modern versions of Puppeteer. The change required revisiting a few function calls, but overall it simplified my code since page.$x returns an array of elements directly. This change worked well with the rest of my automation script.
During a similar hardware upgrade, I encountered issues where Puppeteer-extra seemed to lack support for waitForXPath. It turned out that the updated versions shift focus towards using page.$x, which directly returns an array of elements, making element retrieval more straightforward. I adjusted my code to conform to this new standard and cross-checked official documentation for any further changes in the API. Ensuring that all package versions were compatible with each other also helped resolve the issue, leading to a more stable automation setup.
hey, try using page.$x instead of waitForXPath. had a similar issue after an upgrade, and double checking your package versions did the trick for me. docs might have extra info too, hope it helps!