Ich will wählen Iframe mit id = "iframe00237" und Daten im Inneren:Wie wähle ich Iframe in Selen?
Diese HTML ist:
<iframe src="http://example/iframe/v2.html?id=5225dddd-588a-49c2-961e-e3417cf5a728 scrolling="no" frameborder="0" marginwidth="0" marginheight="0" width="100%" height="100%" allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true" id="iframe09328" class="sm_iframe"></iframe>
<body>
<div>
<iframe src="http://example.com/main?id=aab0619b-a938-4f00-b545-742fff5e1118&crtdt=1461214262& scrolling="no" frameborder="0" marginwidth="0" marginheight="0" allowfullscreen="allowfullscreen" id="iframe05443" class="sm_iframe" style="left: 0px; top: 0px; width: 730px; height: 411px;"></iframe>
</div>
<div>
<iframe src="http://example.com/main?id=5225dddd-588a-49c2-961e-e3417cf5a728& scrolling="no" frameborder="0" marginwidth="0" marginheight="0" allowfullscreen="allowfullscreen" id="iframe00237" class="sm_iframe" style="left: 0px; top: 0px; width: 811px; height: 456px;"></iframe>
</div>
</body>
Iframe src="url"
url zufällig ist ..
Ich bin in der Suche und versuchen Stackoverflow mit Code:
//Select parent frame
IWebElement parentFrame = driver.FindElement(By.XPath("//iframe[@id='iframe09328']"));
driver.SwitchTo().Frame(detailFrame);
//Current we on detailFrame continues to go to childFrame.
IWebElement childFrame = driver.FindElement(By.XPath("//iframe[@id='iframe00237']"));
driver.SwitchTo().Frame(childFrame);
Im Debug-Modus, parentFrame
und childFrame
immer null
Werte.
Wie kann ich mein Problem lösen? Ich versuche auch FindElement by ID
.
sind der Rahmen von dynamischen IDs? – Paras
@pArAs Die Rahmen-ID ist Konstanten. – vanloc
Stehen Sie diesem Problem nur im Debug-Modus gegenüber? – Paras