如何识别以下html代码中的Button元素
<TABLE id=aotbl_fileDetailsfields border=0 cellSpacing=0 cellPadding=0 width="100%"><TBODY>
<TR class=rowalternate>
<TD width="12%"><LABEL id=aolbl_filePath>File Path</LABEL> <LABEL class=labelmandate>*</LABEL> </TD>
<TD width="2%"><LABEL class=labelcolan>:</LABEL> </TD>
<TD width="30%">
<DIV style="POSITION: relative"><INPUT style="FILTER: alpha(opacity:0); HEIGHT: 30px; -moz-opacity: 0; opacity: 0" onchange="document.getElementById('amtxt_filepath').value=this.value;" tabIndex=-1 name=uploadFile type=file>
<DIV style="Z-INDEX: -1; POSITION: absolute; TOP: 2px; LEFT: 150px">
**<BUTTON class=formBtn tabIndex=-1 onclick="document.getElementById('uploadFile').click();">Browse...</BUTTON>** </DIV>
<DIV style="Z-INDEX: 1; POSITION: absolute; TOP: 0px; LEFT: 0px"><INPUT id=amtxt_filePath title="" name=amtxt_filePath.value maxLength=75> </DIV></DIV></TD>
<TD width="12%"><LABEL id=aolbl_worksheetName>Worksheet Name</LABEL> <LABEL id=aolbl_worksheetName_mandatory></LABEL></TD>
<TD width="2%"><LABEL id=aolbl_worksheetName_colan></LABEL></TD>
<TD width="30%"><INPUT id=amtxt_worksheetName class=reqInfo name=amtxt_worksheetName.value maxLength=50> </TD></TR></TBODY></TABLE>
答案 0 :(得分:2)
//button[text()='Browse...']
或class=formBtn
答案 1 :(得分:1)
除了已经说过的内容,使用CSS定位器:
button.formBtn
答案 2 :(得分:0)
我在firefox中使用firebug并使用小方框(在鼠标悬停时)“单击要检查的元素”,然后右键单击firebug中突出显示的html以获取诸如“copy xpath”或“copy css”之类的选项路径”。