Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.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
Selenium 如何选择(或单击)表中的按钮 我有一个如下表,有两个按钮,如何选择“第一”行的按钮? 最后一次心跳的状态 第一 5秒前 第二 17秒前_Selenium - Fatal编程技术网

Selenium 如何选择(或单击)表中的按钮 我有一个如下表,有两个按钮,如何选择“第一”行的按钮? 最后一次心跳的状态 第一 5秒前 第二 17秒前

Selenium 如何选择(或单击)表中的按钮 我有一个如下表,有两个按钮,如何选择“第一”行的按钮? 最后一次心跳的状态 第一 5秒前 第二 17秒前,selenium,Selenium,试试这个: WebElement we = driver.findElement(By.xpath("//*[contains(text(),'FIRST')]/preceding::button[1]")); we.click(); 试试这个: WebElement we = driver.findElement(By.xpath("//*[contains(text(),'FIRST')]/preceding::button[1]")); we.click(); $(“.table.bt

试试这个:

WebElement we = driver.findElement(By.xpath("//*[contains(text(),'FIRST')]/preceding::button[1]"));
we.click();
试试这个:

WebElement we = driver.findElement(By.xpath("//*[contains(text(),'FIRST')]/preceding::button[1]"));
we.click();

$(“.table.btn”)
请发布您尝试过的代码以及您收到的错误消息或其不符合要求的原因。
$(“.table.btn”)
请发布您尝试过的代码以及您收到的错误消息或其不符合要求的原因。