我正在尝试从 div 中获取数字。当我执行我的测试用例时,新数字正在显示,现在我想获取该数字,或者换句话说,将其打印在控制台中。
我正在使用:
webElement webelement=driver.findElement(By.xpath("//div[contains(@class,'responsive now') and text()='Application number']"));
webelement.getText();
和
driver.findElement(By.xpath("//div[@class='responsive-show']")).getAttribute("value");
它不是关于定位器的compailining,但它没有显示数字。
<td>
<div class="responsive-show">Application number</div>
"3204255"
<input data val="true" data-val-number="The field ExaminationNumber must be a number." data-val-required="The ExaminationNumber field is required." id="ActiveExamModeIs_0__ExaminationNumber" name="ActiveExamMode[0].ExaminationNumber" type="hidden" value="3204255">
<input data -val="true" data-val-number="The field ExaminationEligibilityExamTypeId must be a number" data-val-required="The ExaminationEligibilityExamTypeId fiels is required." type="hidden" value="1">
</td>
慕的地8271018
慕田峪7331174
芜湖不芜
相关分类