I have the following code snippet:
export async function waitTillClickable(e: ElementFinder): Promise<ElementFinder> {
const conditions = EC.visibilityOf(e);
await browser.wait(conditions, DEFAULT_TIMEOUT, `Element did not return within ${DEFAULT_TIMEOUT / 1000} seconds: ${e}`);
return e;
}
The issue I am facing is that when it times out or cannot find the element, it displays the message:
Element did not return within 10 seconds: [Object][Object]
Instead of showing [Object][Object], I would like to see which locator it failed for, such as by.xpath('//...')
. I attempted using JSON.stringify on {e}
, but that did not provide the desired outcome.