We can get a list of frame names available on a page as below:
//Make sure you are in default frame
driver.switchTo().defaultContent();
List framesetList=driver.findElements(By.tagName("frame"));
if(framesetList.size()>0){
for(WebElement framename :framesetList){
System.out.println("Frame with name:" + framename.getAttribute("name")+" found.");
}
}
else {
System.out.println("No frame found");
}