在“插入标记”中单击“停止”按钮时需要帮助。尝试使用Xpath,名称和值。插入标记中没有ID
driver.findElement(By.xpath(" HTML /体/格[1] / DIV /表/ tbody的/ TR / TD /表[5] / tbody的/ TR [3] / TD [1] /形式/表[2] / tbody的/ TR [9] / TD [2] /输入"))点击(); - 没用?
<body>
<noscript/>
<!--/DO NOT REMOVE/-->
<!-- End SiteCatalyst code version: H.22. -->
<!--END HTML HEADER-->
<script type="text/javascript"> $(document).ready(function () { SLM.ON.FWF.HTMLPage.initialize(); }) </script>
<div class="DIVBackGround">
<div class="DIVPrimaryArea">
<noscript> <table border="0" cellspacing="0" cellpadding="0" width="762"> <tr> <td width="324"></td> <td width="416"> <font color="red">Your browser's security settings do not allow JavaScript. You must change the settings to support JavaScript in order to use this application.</font> </td> </tr> </table> </noscript>
<!-- PARENT CONTAINER TO MANAGE WIDTH OF SECTIONS-->
<table cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td>
<!--BEGIN HEADER-->
<table class="TableHeader" cellspacing="0" cellpadding="0" border="0" width="1012">
<table cellspacing="0" cellpadding="0" border="0" width="1012">
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<table cellspacing="0" cellpadding="0" border="0" width="1012">
<!--END HEADER-->
<!--BEGIN WORKSPACE -->
<table class="TableBody" cellspacing="0" cellpadding="0" border="0" width="1012">
<tbody>
<tr>
<tr>
<tr>
<td>
<form name="mainform" method="POST" action="/QUERY/?CharSet=ENGLISH&AppMode=SLM&TS=5%2f30%2f2017+10%3a53%3a26+AM" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<input name="SessionID" value="511036a7eec646b79ef2fe388928dd39" type="hidden"/>
<input name="StateID" value="431DCC44-5ED0-46EF-A42A-CB3FDE441083:3cbf085a-eb1a-4360-a35d-0c110a9593a0" type="hidden"/>
<input name="EntryPointName" value="" type="hidden"/>
<input name="Selection" value="SearchAgain" type="hidden"/>
<input name="Key" value="" type="hidden"/>
<input name="Name" value="" type="hidden"/>
<input name="PrevPage" value="ServicingLoanSummary" type="hidden"/>
<input name="PageStack" value="" type="hidden"/>
<table cellspacing="0" cellpadding="0" border="0" width="762">
<table cellspacing="0" cellpadding="0" border="0" width="762">
<tbody>
<tr>
<tr>
<tr>
<tr>
<tr>
<tr>
<tr>
<tr>
<tr>
<td/>
<td class="NavigationButtons" colspan="3">
<input class="ButtonLabel" name="btnDiscontinue" value="Discontinue" onclick="SLM.ON.QUERY.SubmitPage('Discontinue')" type="button"/>
</td>
</tr>
</tbody>
</table>
答案 0 :(得分:0)
你可以试试吗? tag_pattern
答案 1 :(得分:0)
尝试使用以下内容:
driver.findElement(By.cssSelector("form table tr:nth-child(9) td>input")).click()
或使用JavaScriptExecutor
WebElement yourElement = river.findElement(By.cssSelector("form table tr:nth-child(9) td>input"));
((JavascriptExecutor) driver).executeScript("arguments[0].click",yourElement);