【问题标题】:What are the steps involved for svg button click and copy the urlsvg 按钮单击并复制 url 涉及的步骤是什么
【发布时间】:2021-03-30 08:03:17
【问题描述】:

使用空手道框架编写 UI 测试的步骤 所以基本上是 svg 按钮,必须单击新选项卡中的 URL 以进行进一步的功能处理 如何处理?

我试过下面的代码

  • def secure_url = mouse("#root > section > section > main > div > div > div.ant-table-wrapper > div > div > div > div > div > table > tbody > tr:nth-child( 1) > td:nth-child(7) > span > button > svg").click()

并使用验证了secure_url值 打印安全网址 它打印 com.intuit.karate.driver.DriverMouse@664e5dee 但预期是 URL

【问题讨论】:

    标签: automation karate


    【解决方案1】:

    大多数空手道方法将返回一个Element 对象,您必须在该对象上调用更多方法。请花点时间阅读文档:https://github.com/intuit/karate/tree/master/karate-core#chaining

    * def elem = locate('#some-id')
    * def url = elem.attribute('href')
    

    【讨论】:

    猜你喜欢
    • 2014-01-10
    • 2016-08-10
    • 2013-12-01
    • 2017-08-15
    • 2017-05-07
    • 1970-01-01
    • 2010-09-07
    • 2017-04-18
    相关资源
    最近更新 更多