Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/258.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 从多个DIV元素中识别按钮_C#_Selenium_Webdriver - Fatal编程技术网

C# 从多个DIV元素中识别按钮

C# 从多个DIV元素中识别按钮,c#,selenium,webdriver,C#,Selenium,Webdriver,如何在下面的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

如何在下面的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>

文件路径*
: 
**浏览…**
工作表名称

//按钮[text()=“Browse…”]
class=formBtn
//按钮[text()=“Browse…”]
class=formBtn
我在firefox中使用firebug,并使用小方形框(在鼠标上方)“单击要检查的元素”然后右键单击firebug中突出显示的html以获得诸如“复制xpath”或“复制css路径”之类的选项。

我在firefox中使用firebug,并使用小方框(在鼠标上方)“单击要检查的元素”,然后右键单击firebug中突出显示的html以获得诸如“复制xpath”或“复制css路径”之类的选项.

除了已经说过的,使用CSS定位器:

button.formBtn

除了已经说过的,使用CSS定位器:

button.formBtn

没有按钮元素!你所说的
Idenfying
是什么意思?没有按钮元素!你所说的识别是什么意思?答案是什么?BTWhmmm检测的问题是什么?他已经点击了aleady的附件。点击该按钮或任何其他selenium操作。他无法检测到按钮,因为有许多div标签。答案是什么?BTWhmmm检测的问题是什么?他已经点击了aleady的附件。点击该按钮或任何其他selenium操作。他无法检测按钮,因为有许多div标记。CSS选择器是检测按钮元素的更好选项。CSS选择器是检测按钮元素的更好选项。