如何使用Xpath selenium java从Ngx数据表中获取文本

如何使用Xpath selenium java从Ngx数据表中获取文本,java,selenium,ngx-datatable,Java,Selenium,Ngx Datatable,试图获取文本但返回URL 结果:xpath://*[@id=“tableContent”]/div[2]/span/a] WebElement NumberofRecord = driver.findElement(By.xpath("//*[@id=\"tableContent\"]/div[2]/span/a")); NumberofRecord.getText(); System.out.println(Numbero

试图获取文本但返回URL

结果:xpath://*[@id=“tableContent”]/div[2]/span/a]

WebElement NumberofRecord = driver.findElement(By.xpath("//*[@id=\"tableContent\"]/div[2]/span/a"));
NumberofRecord.getText();               

System.out.println(NumberofRecord);

导入
WebDriverWait
并等待
找到的元素的可见性
(),然后获取文本值

Expected Output: All 18418 Messages in Table are selected. Clear selection(this need to be displayed)

诱导
WebDriverWait
并等待
元素定位的可见性
(),然后获取文本值

Expected Output: All 18418 Messages in Table are selected. Clear selection(this need to be displayed)

发布相关html?您是指具有文本值
18418
的锚定标记,还是表中有
18418
锚定标记的编号?@KunduK i已添加图像请检查==$0“表中所有1810条消息均已选中。”清晰选择说明:消息编号始终取决于记录数。发布相关html?您是指具有文本值
18418
的锚定标记,还是表中有
18418
锚定标记编号?@KunduK i已添加图像请检查==$0“表中的所有1810条消息均已选中。”清除选择注意:消息编号始终取决于记录的数量。