我有一个带有下表的网页
Assessment name | Task | Status
Test A | Practice | Not started
| Assessment | Not started
Test B | Practice | Not started
| Assessment | Not started
还可以找到它的 html 代码。
<table class="gridRow" cellspacing="0" summary="For each assessment" style="border-collapse:collapse;">
<tr>
<th class="gridHeaderHide" scope="col"> </th><th class="gridHeader" scope="col">Assessment name</th><th class="gridHeader" scope="col">Task</th><th class="gridHeader" scope="col">Status</th><th class="gridHeader" scope="col" abbr="Overall time you will need">Overall time you will need</th><th class="gridHeader" scope="col" abbr="Time limit">Time limit</th><th class="gridHeader" scope="col"><a tabindex="502" href="javascript:__doPostBack('ctl00$ErrorMessageContentPlaceHolder$gdvAssessmentHome','Sort$Deadline')">Deadline</a></th><th class="gridHeaderWhatUNeed" scope="col" abbr="What you need">What you need </th>
</tr><tr class="gridRow" align="center">
<td class="gridcolHide" rowspan="2">
<div style='display:none'>
<img id="ctl00_ErrorMessageContentPlaceHolder_gdvAssessmentHome_ctl02_imgCompleted" title="Completed" src="../Images/completed.gif" alt="Completed" style="border-width:0px;" />
</div>
</td><td class="gridcol" rowspan="2">
<span id="ctl00_ErrorMessageContentPlaceHolder_gdvAssessmentHome_ctl02_lblCandidateFriendlyName">Test A</span>
</td><td class="gridcol">
<input type="submit" name="ctl00$ErrorMessageContentPlaceHolder$gdvAssessmentHome$ctl02$PracticeTask" value="Practice" id="ctl00_ErrorMessageContentPlaceHolder_gdvAssessmentHome_ctl02_PracticeTask" tabindex="503" class="linkButton" />
</td><td class="gridcol">Not started</td><td class="gridcol">
15 <span id="ctl00_ErrorMessageContentPlaceHolder_gdvAssessmentHome_ctl02_lblMins1" class="label">Minutes</span>
</td><td class="centeredImage">
<div style='display:block'>
<img id="ctl00_ErrorMessageContentPlaceHolder_gdvAssessmentHome_ctl02_PractiseImage" src="../Images/AH_Transparent_Icon.gif" alt=" " style="border-width:0px;" />
</div>
<div style='display:none'>
<img id="ctl00_ErrorMessageContentPlaceHolder_gdvAssessmentHome_ctl02_imgClock" title="Timer on" src="../Images/timer_on.gif" alt="Timer on" style="border-width:0px;" />
<span id="ctl00_ErrorMessageContentPlaceHolder_gdvAssessmentHome_ctl02_lblMins" class="label">Minutes</span>
</div>
<div style='display:none'>
<img id="ctl00_ErrorMessageContentPlaceHolder_gdvAssessmentHome_ctl02_imgTimerPlusOn" title="Extra time allowed" src="../Images/Timer_plus.gif" alt="Extra time allowed" style="border-width:0px;" />
<span id="ctl00_ErrorMessageContentPlaceHolder_gdvAssessmentHome_ctl02_Label2" class="label">Minutes</span>
</div>
<div style='display:none'>
<img id="ctl00_ErrorMessageContentPlaceHolder_gdvAssessmentHome_ctl02_imgTimerOff" title="Timer off" src="../Images/Timer_plus.gif" alt="Timer off" style="border-width:0px;" />
<span id="ctl00_ErrorMessageContentPlaceHolder_gdvAssessmentHome_ctl02_Label1" class="label">Minutes</span>
</div>
<div style='display:none'>
<img id="ctl00_ErrorMessageContentPlaceHolder_gdvAssessmentHome_ctl02_imgTimerPlusOff" title="Extra time allowed" src="../Images/Timer_plus.gif" alt="Extra time allowed" style="border-width:0px;" />
<span id="ctl00_ErrorMessageContentPlaceHolder_gdvAssessmentHome_ctl02_Label3" class="label">Minutes</span>
</div>
</td><td class="gridcol" rowspan="2">21/03/2013</td><td class="gridcolWhatUNeed" rowspan="2">
<img id="ctl00_ErrorMessageContentPlaceHolder_gdvAssessmentHome_ctl02_imgMouse" title="Mouse" src="../Images/Mouse.gif" alt="Mouse" style="border-width:0px;" />
</td>
</tr><tr class="gridRow" align="center">
<td class="gridcol">
<input type="submit" name="ctl00$ErrorMessageContentPlaceHolder$gdvAssessmentHome$ctl03$PracticeTask" value="Take assessment" id="ctl00_ErrorMessageContentPlaceHolder_gdvAssessmentHome_ctl03_PracticeTask" tabindex="504" class="linkButton" />
</td><td class="gridcol">Not started</td><td class="gridcol">
30 <span id="ctl00_ErrorMessageContentPlaceHolder_gdvAssessmentHome_ctl03_lblMins1" class="label">Minutes</span>
</td><td class="centeredImage">
<div style='display:none'>
<img id="ctl00_ErrorMessageContentPlaceHolder_gdvAssessmentHome_ctl03_PractiseImage" src="../Images/AH_Transparent_Icon.gif" alt=" " style="border-width:0px;" />
</div>
<div style='display:block'>
<img id="ctl00_ErrorMessageContentPlaceHolder_gdvAssessmentHome_ctl03_imgClock" title="Timer on" src="../Images/timer_on.gif" alt="Timer on" style="border-width:0px;" />
19 <span id="ctl00_ErrorMessageContentPlaceHolder_gdvAssessmentHome_ctl03_lblMins" class="label">Minutes</span>
</div>
<div style='display:none'>
<img id="ctl00_ErrorMessageContentPlaceHolder_gdvAssessmentHome_ctl03_imgTimerPlusOn" title="Extra time allowed" src="../Images/Timer_plus.gif" alt="Extra time allowed" style="border-width:0px;" />
19 <span id="ctl00_ErrorMessageContentPlaceHolder_gdvAssessmentHome_ctl03_Label2" class="label">Minutes</span>
</div>
<div style='display:none'>
<img id="ctl00_ErrorMessageContentPlaceHolder_gdvAssessmentHome_ctl03_imgTimerOff" title="Timer off" src="../Images/Timer_plus.gif" alt="Timer off" style="border-width:0px;" />
19 <span id="ctl00_ErrorMessageContentPlaceHolder_gdvAssessmentHome_ctl03_Label1" class="label">Minutes</span>
</div>
<div style='display:none'>
<img id="ctl00_ErrorMessageContentPlaceHolder_gdvAssessmentHome_ctl03_imgTimerPlusOff" title="Extra time allowed" src="../Images/Timer_plus.gif" alt="Extra time allowed" style="border-width:0px;" />
19 <span id="ctl00_ErrorMessageContentPlaceHolder_gdvAssessmentHome_ctl03_Label3" class="label">Minutes</span>
</div>
</td>
</tr><tr class="gridRow" align="center">
<td class="gridcolHide" rowspan="2">
<div style='display:none'>
<img id="ctl00_ErrorMessageContentPlaceHolder_gdvAssessmentHome_ctl04_imgCompleted" title="Completed" src="../Images/completed.gif" alt="Completed" style="border-width:0px;" />
</div>
</td><td class="gridcol" rowspan="2">
<span id="ctl00_ErrorMessageContentPlaceHolder_gdvAssessmentHome_ctl04_lblCandidateFriendlyName">Test B</span>
</td><td class="gridcol">
<input type="submit" name="ctl00$ErrorMessageContentPlaceHolder$gdvAssessmentHome$ctl04$PracticeTask" value="Practice" id="ctl00_ErrorMessageContentPlaceHolder_gdvAssessmentHome_ctl04_PracticeTask" tabindex="505" class="linkButton" />
</td><td class="gridcol">Not started</td><td class="gridcol">
15 <span id="ctl00_ErrorMessageContentPlaceHolder_gdvAssessmentHome_ctl04_lblMins1" class="label">Minutes</span>
</td><td class="centeredImage">
<div style='display:block'>
<img id="ctl00_ErrorMessageContentPlaceHolder_gdvAssessmentHome_ctl04_PractiseImage" src="../Images/AH_Transparent_Icon.gif" alt=" " style="border-width:0px;" />
</div>
<div style='display:none'>
<img id="ctl00_ErrorMessageContentPlaceHolder_gdvAssessmentHome_ctl04_imgClock" title="Timer on" src="../Images/timer_on.gif" alt="Timer on" style="border-width:0px;" />
<span id="ctl00_ErrorMessageContentPlaceHolder_gdvAssessmentHome_ctl04_lblMins" class="label">Minutes</span>
</div>
<div style='display:none'>
<img id="ctl00_ErrorMessageContentPlaceHolder_gdvAssessmentHome_ctl04_imgTimerPlusOn" title="Extra time allowed" src="../Images/Timer_plus.gif" alt="Extra time allowed" style="border-width:0px;" />
<span id="ctl00_ErrorMessageContentPlaceHolder_gdvAssessmentHome_ctl04_Label2" class="label">Minutes</span>
</div>
<div style='display:none'>
<img id="ctl00_ErrorMessageContentPlaceHolder_gdvAssessmentHome_ctl04_imgTimerOff" title="Timer off" src="../Images/Timer_plus.gif" alt="Timer off" style="border-width:0px;" />
<span id="ctl00_ErrorMessageContentPlaceHolder_gdvAssessmentHome_ctl04_Label1" class="label">Minutes</span>
</div>
<div style='display:none'>
<img id="ctl00_ErrorMessageContentPlaceHolder_gdvAssessmentHome_ctl04_imgTimerPlusOff" title="Extra time allowed" src="../Images/Timer_plus.gif" alt="Extra time allowed" style="border-width:0px;" />
<span id="ctl00_ErrorMessageContentPlaceHolder_gdvAssessmentHome_ctl04_Label3" class="label">Minutes</span>
</div>
</td><td class="gridcol" rowspan="2">21/03/2013</td><td class="gridcolWhatUNeed" rowspan="2">
<img id="ctl00_ErrorMessageContentPlaceHolder_gdvAssessmentHome_ctl04_imgMouse" title="Mouse" src="../Images/Mouse.gif" alt="Mouse" style="border-width:0px;" /><img id="ctl00_ErrorMessageContentPlaceHolder_gdvAssessmentHome_ctl04_imgCalculator" title="Calculator" src="../Images/Calculator.gif" alt="Calculator" style="border-width:0px;" /><img id="ctl00_ErrorMessageContentPlaceHolder_gdvAssessmentHome_ctl04_imgPaper" title="Pen and paper" src="../Images/pen_and_paper.gif" alt="Pen and paper" style="border-width:0px;" />
</td>
</tr><tr class="gridRow" align="center">
<td class="gridcol">
<input type="submit" name="ctl00$ErrorMessageContentPlaceHolder$gdvAssessmentHome$ctl05$PracticeTask" value="Take assessment" id="ctl00_ErrorMessageContentPlaceHolder_gdvAssessmentHome_ctl05_PracticeTask" tabindex="506" class="linkButton" />
</td><td class="gridcol">Not started</td><td class="gridcol">
30 <span id="ctl00_ErrorMessageContentPlaceHolder_gdvAssessmentHome_ctl05_lblMins1" class="label">Minutes</span>
</td><td class="centeredImage">
<div style='display:none'>
<img id="ctl00_ErrorMessageContentPlaceHolder_gdvAssessmentHome_ctl05_PractiseImage" src="../Images/AH_Transparent_Icon.gif" alt=" " style="border-width:0px;" />
</div>
<div style='display:block'>
<img id="ctl00_ErrorMessageContentPlaceHolder_gdvAssessmentHome_ctl05_imgClock" title="Timer on" src="../Images/timer_on.gif" alt="Timer on" style="border-width:0px;" />
25 <span id="ctl00_ErrorMessageContentPlaceHolder_gdvAssessmentHome_ctl05_lblMins" class="label">Minutes</span>
</div>
<div style='display:none'>
<img id="ctl00_ErrorMessageContentPlaceHolder_gdvAssessmentHome_ctl05_imgTimerPlusOn" title="Extra time allowed" src="../Images/Timer_plus.gif" alt="Extra time allowed" style="border-width:0px;" />
25 <span id="ctl00_ErrorMessageContentPlaceHolder_gdvAssessmentHome_ctl05_Label2" class="label">Minutes</span>
</div>
<div style='display:none'>
<img id="ctl00_ErrorMessageContentPlaceHolder_gdvAssessmentHome_ctl05_imgTimerOff" title="Timer off" src="../Images/Timer_plus.gif" alt="Timer off" style="border-width:0px;" />
25 <span id="ctl00_ErrorMessageContentPlaceHolder_gdvAssessmentHome_ctl05_Label1" class="label">Minutes</span>
</div>
<div style='display:none'>
<img id="ctl00_ErrorMessageContentPlaceHolder_gdvAssessmentHome_ctl05_imgTimerPlusOff" title="Extra time allowed" src="../Images/Timer_plus.gif" alt="Extra time allowed" style="border-width:0px;" />
25 <span id="ctl00_ErrorMessageContentPlaceHolder_gdvAssessmentHome_ctl05_Label3" class="label">Minutes</span>
</div>
</td>
</tr><tr class="gridRow" align="center">
现在我必须 clcik 测试 B - 练习链接我使用以下 xpath 来单击它,因为链接是动态加载的
xpath=//*[contains(text(),'Test B')]/../../td[3]/input
这适用于特定语言,但是当我更改网页的显示语言(比如中文)时,它不起作用。
请帮助如何点击链接。注意:网页可能单独包含Test B行或同时包含Test A和Test B。(动态加载)我必须根据测试选择练习链接
如果需要更多信息,请告诉我