DIS*_*SHI 0 iframe robotframework
HTML看起来像这样
<iframe src="/apex/cscfga__ConfigureProduct?linkedId=a0W8E000000Lpa5UAC&configId=a0Z8E000000NBGMUA4&retURL=/a0W8E000000Lpa5UAC&isdtp=vw" width="100%" height="100%" onload="hideLoading()" frameborder="0" style="height: 737px;"></iframe>Run Code Online (Sandbox Code Playgroud)
如果没有id,选择框架不起作用.我的机器人脚本应该如何识别这个iframe(没有id)?
我的脚本看起来像
${Iframe}= Execute Javascript
window.document.getElementsByTagName('iframe')[2]
log ${Iframe}
Run Code Online (Sandbox Code Playgroud)
但它返回'无'
请建议如何识别此iframe.
Select Frame将适用于任何类型的定位器.例如,如果它是页面上唯一的iframe,您可以执行以下操作:
select frame xpath=//iframe
Run Code Online (Sandbox Code Playgroud)
如果页面上有多个iframe,则需要尝试查找唯一可识别的祖先,然后查找相对于该框架的框架.
例如,给定以下html:
<div class="spreadsheet_container">
<div>
<iframe ...>
Run Code Online (Sandbox Code Playgroud)
...您可以使用如下的xpath:
select frame xpath=//div[@class='spreadsheet_container']/div/iframe
Run Code Online (Sandbox Code Playgroud)