【发布时间】:2019-07-28 15:58:40
【问题描述】:
【问题讨论】:
标签: selenium xpath automation cucumber cucumber-serenity
【问题讨论】:
标签: selenium xpath automation cucumber cucumber-serenity
我需要查看更多周围的 html,但如果我正确理解您的问题,您需要包含带有文本“Ver informe”的元素的按钮。 试试这个:
//div[4]//article[1]//descendant::button[@type='button' and ./*[contains(text(),'Ver informe')]]
【讨论】:
基本上,跨度被包裹在按钮标签中。所以你可以使用下面的xpath。
//span[normalize-space(.)='Ver informe']/parent::button
【讨论】: