I am trying to locate an iframe by partial id. For this method, I used:
driver.switchTo().frame(driver.findElement(By.cssSelector(\"iframe[id*=\'card-fields-number\']
As the iframe has tag iframe, you can switch to the iframe using the tagname like: driver.switchTo().frame(driver.findElement(By.tagName("iframe")));
And if you want to again switch to the default content, then you can use driver.switchTo().defaultContent();