【问题标题】:select the next button- xpath-selenium选择下一个按钮 - xpath-selenium
【发布时间】:2019-07-28 15:58:40
【问题描述】:

我正好在有文本 ='Ver Informe' 的那一行。

我想转到该行旁边的按钮。

因为只有当我在那里点击时才有效。

你能帮我去那里吗?

我试过了:/button1——但不起作用。

【问题讨论】:

    标签: selenium xpath automation cucumber cucumber-serenity


    【解决方案1】:

    我需要查看更多周围的 html,但如果我正确理解您的问题,您需要包含带有文本“Ver informe”的元素的按钮。 试试这个:

    //div[4]//article[1]//descendant::button[@type='button' and ./*[contains(text(),'Ver informe')]]
    

    【讨论】:

      【解决方案2】:

      基本上,跨度被包裹在按钮标签中。所以你可以使用下面的xpath。

      //span[normalize-space(.)='Ver informe']/parent::button
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2020-11-25
        • 1970-01-01
        • 1970-01-01
        • 2021-09-29
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多