svg按钮单击并复制url涉及哪些步骤 [英] What are the steps involved for svg button click and copy the url
问题描述
使用空手道框架进行UI测试的编写步骤因此基本上是svg按钮,必须先单击新标签中的URL才能进行进一步的功能处理该如何处理?
Writing steps for UI testing using karate framework so basically svg button, have to click then the URL in the new tab for further functionality processing how to handle that ?
我尝试了以下代码
- def secure_url = mouse(" #root>部分>部分>主> div> div> div.ant-table-wrapper> div> div> div> div>div>表> tbody> tr:nth-child(1)> td:nth-child(7)> span>按钮> svg).click()
并使用验证了secure_url值打印secure_url它会打印com.intuit.karate.driver.DriverMouse@664e5dee但应该是URL
and verified the secure_url value using print secure_url it prints com.intuit.karate.driver.DriverMouse@664e5dee but Expected is URL
推荐答案
大多数空手道方法将返回一个 Element
对象,您必须在该对象上调用更多方法.请花一些时间阅读文档: https://github.com/intuit/karate/tree/master/karate-core#chaining
Most Karate methods will return an Element
object on which you have to call more methods. Please spend some time to read the docs: https://github.com/intuit/karate/tree/master/karate-core#chaining
* def elem = locate('#some-id')
* def url = elem.attribute('href')
这篇关于svg按钮单击并复制url涉及哪些步骤的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!