Experiencing an issue with Webdriver: when attempting to pass a constant to frame() in the driver.switchTo() command, an error is thrown stating that id cannot be a string. This seems to contradict the information provided in the selenium documentation where passing a string should work as expected.
let newAd = await driver.findElement(By.css('*[data-google-query-id]'))
let getIframe = await newAd.findElement(By.css('iframe'))
let iframeName = await getIframe.getAttribute('name')
console.log(await iframeName);
let currentIframe = await driver.switchTo().frame(iframeName)
console.log(await currentIframe)
Any thoughts on why this might be happening?