启动自动预呼(Shipper)
 启动自动预呼(收货人)
 记录手动预呼(Shipper)
 记录手动预呼(收货人)

最佳答案

根据注释中给定的代码,找到了您列出的元素查找解决方案。

解决方案1:

使用元素列表并获取它。

 List<WebElement> allOptions = driver.findElements(By.className("ui-corner-all"));


现在按索引获取元素。

用于启动自动预呼(Shipper)allOptions.get(0);

发起自动预呼(收货人)allOptions.get(1);

对于日志手动预调用(Shipper)allOptions.get(2);

对于日志手动预呼(收货人)allOptions.get(3);

解决方案2:

使用xpath如下:

用于启动自动预呼(Shipper)(//a[@class='ui-corner-all'])[1]

发起自动预呼(收货人)(//a[@class='ui-corner-all'])[2]

对于日志手动预调用(Shipper)(//a[@class='ui-corner-all'])[3]

对于日志手动预呼(收货人)(//a[@class='ui-corner-all'])[4]

driver.findElement(By.xpath("<xpath>"));


解决方案3:

在xpath中使用text()和contains()函数。

用于启动自动预呼(Shipper)

//a[contains(text(),'Initiate') and contains(text(),'Shipper')]

发起自动预呼(收货人)

//a[contains(text(),'Initiate') and contains(text(),'Consignee')]

对于日志手动调用(Shipper)

//a[contains(text(),'Log') and contains(text(),'Shipper')]

对于日志手动预呼(收货人)

//a[contains(text(),'Log') and contains(text(),'Consignee')]

driver.findElement(By.xpath("<xpath>"));


希望您找到解决方案。

10-08 16:48