我试图把这个xpath放在eclipse中,但它不起作用。任何的想法?我不得不说我在HER'S SISTEM S.A之间加上“”,因为这个名字也有“'”所以我必须使用“”来指定特定的文字,我的机器人会识别这个文本,如果我把'她的SISTEM S.A.'出现“'”之前出现错误,因为有三个“'”。所以我不确定如何在eclipse中解决这个问题。
在我的方法上有一个文本和另一个文本,我不能使用''这个因为我必须在我的xpath中使用它。
我的xpath的方法在这里:
WebElement SeleccionCuentaDeOportunidad = findBy(String.format(“(// * [contains(@ title,'Jonathan')] // parent :: span [1] / parent :: th [1] // follow-sibling :: td [position()= 1] // child :: a [1])[@ title =“HER'S SISTEM SA”]“));
提前致谢。
这是解决方案。
WebElement SeleccionCuentaDeOportunidad =findBy(String.format("(//*[contains(@title,'Jonathan')]//parent::span[1]/parent::th[1]//following-sibling::td[position()=1]//child::a[1])[@title=\"HER'S SISTEM S.A.\"]"))