So far, this is what I have: I've switched the frame to its parent frame then to the the frame I am unable to locate:
By frame = By.xpath("//iframe[@class='GenCss_style-Model']");
driver.switchTo().frame(driver.findElement(By.name("documentflowdesk")));
driver.switchTo().frame(driver.findElement(frame));
Since 'frame' element is not found, I get this error:
org.openqa.selenium.NoSuchElementException: Unable to locate element
HTML:
<iframe src="about:blank" name="documentflowdesk" class="gwt-Frame-NavigationComponentViewImplResourcesapplicationFrame" id="documentflowdesk" style="position: absolute; left: 0px; top: 0px; visibility: visible; height: 100%;"></iframe>
#documentflowdesk
<html style="overflow: hidden;">
<head>...</head>
<body style="margin: 0px;" class="dragdrop-dropTarget dragdrop-boundary">
<noscript>...</noscript>
<div style="position: absolute; overflow: hidden; left: 0px; top: 0px; right: 0px; bottom: 0px;">
<div class="css-DeskStyleResources" style="position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px;">
<div style="position: absolute; overflow: hidden; left: 0px; top: 0px; right: 0px; bottom: 0px;">
<div style="position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px;">
<div style="position: absolute; overflow: hidden; left: 0px; top: 0px; right: 0px; bottom: 0px;">
<iframe class="GenCss_style-Model" src="/model/?modelId=100&docGroupId=164&connectionPointId=73" style="position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px;"></iframe>
The iframe I'm trying to locate is inside multiple div. Does it have to do anything with the error? Or is there a problem with how I find my element?