我使用的是robot框架,具有以下DOM:-
<div class="fancybox-inner" style="overflow: hidden; width: 940px; height: 635px;"><iframe id="fancybox-frame1664438391177" name="fancybox-frame1664438391177" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen="" scrolling="auto" src="StartWizard.do?wparam_wizard_name=CustomCreateOrganization"></iframe>
<div class="wizardFooter">
<div id="wizardButtons" class="wizardButtons">
<input type="button" value="Reload" style="display:none">
<input type="button" class="btn alignleft marginrightmini" onclick="disableButton(this);submitForm('wizardForm','back','back','wizardForm');" disabled="true" value="Previous">
<input type="button" class="btn btn-primary alignleft marginrightmini" onclick="disableButton(this);submitForm('wizardForm','next','next','wizardForm');" value="Next">
<input type="button" class="btn alignleft marginrightmini" onclick="disableButton(this);submitForm('wizardForm','finish','finish','wizardForm','1ooqrvebnfv5ff2fcoe6raulan');" disabled="true" value="Done">
<input type="button" class="btn alignright" onclick="disableButton(this);submitForm('wizardForm','org.apache.struts.taglib.html.CANCEL','org.apache.struts.taglib.html.CANCEL','wizardForm');" value="Cancel">
<div class="clear"></div>
</div>
</div>
我无法使用以下选项识别下一个按钮:-
Click Element //*[@id="wizardButtons"]/input[3]
Click Element //*[contains(text(),'Next')]
请帮我做同样的事。
这应该有效:
//div[@class='wizardButtons']//input[@value='Next']
根据一条评论,HTML标记在一个iframe中,这个问题中没有提到。如果是这样的话,并且假设你使用的是SeleniumLibrary,那么在你可以与交互之前,你必须用select frame选择框架
Select frame //iframe[@id="jspContentIframe"]
Click element //div[@class='wizardButtons']//input[@value='Next']