空手道 - locateAll 过滤器和输入字段
Karate - locateAll filter and input field
使用空手道,根据 Karate - is it possible to find element according to part of its parameter 我尝试使用:
* def filter = function(x){ return x.attribute('placeholder').startsWith('Very') }
* def list = locateAll('input[placeholder]', filter)
但我不知道如何使用它来插入值。我试过这个:
* retry().input(list[0], '12312312311111')
还有这个:
* retry().input('list[0]', '12312312311111')
但都没有用。
你知道语法有什么问题吗?
谢谢。
任何 locate
returns 都是 Element
对象。所以你可以调用它的方法。请阅读文档:https://github.com/intuit/karate/tree/master/karate-core#locate
所以这应该有效:
* list[0].input('12312312311111')
* list[0].retry().input('12312312311111')
使用空手道,根据 Karate - is it possible to find element according to part of its parameter 我尝试使用:
* def filter = function(x){ return x.attribute('placeholder').startsWith('Very') }
* def list = locateAll('input[placeholder]', filter)
但我不知道如何使用它来插入值。我试过这个:
* retry().input(list[0], '12312312311111')
还有这个:
* retry().input('list[0]', '12312312311111')
但都没有用。
你知道语法有什么问题吗?
谢谢。
任何 locate
returns 都是 Element
对象。所以你可以调用它的方法。请阅读文档:https://github.com/intuit/karate/tree/master/karate-core#locate
所以这应该有效:
* list[0].input('12312312311111')
* list[0].retry().input('12312312311111')