I encountered an issue with the generic method I wrote for switching to a frame - it keeps throwing the "Maximum call stack size exceeded" error.
My testing framework consists of Cucumber integrated with TypeScript, using Protractor.
Here is the code snippet for the Switch to Frame function:
* @param element
* @param elementName
*/
async switchToFrame(element: ElementFinder, elementName: string)
{
await this.waitForPageToLoad();
await this.waitForElementToBeVisible(element, elementName);
console.log('Switching to frame');
await browser.switchTo().frame(element);
await element.getWebElement();
await browser.sleep(3000);
}