将我的方法放入双倍时间“” - 使用特定文本的XPATH时出错

问题描述 投票:0回答:1

我试图把这个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”]“));

提前致谢。

java eclipse xpath serenity-bdd cucumber-serenity
1个回答
1
投票

这是解决方案。

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.\"]"))
© www.soinside.com 2019 - 2024. All rights reserved.