我是空手道驱动程序的新手,能够自动化大多数UI组件,但在iframe中的元素方面面临挑战。
我提到https://github.com/intuit/karate/blob/develop/karate-core/README.md
而且,
我通过处理同步问题成功地突出显示了iframe。
然后我尝试在文本字段中输入值,但失败了。
尝试对文本字段元素执行"waitFor"以处理任何同步问题。
尝试对附近元素使用"友好定位器"来点击文本字段等
请告知其他方法。
switchFrame()
的文档https://github.com/intuit/karate/tree/develop/karate-core#switchFrame
以下是一个对我有用的脚本摘录:
# switch to iframe by locator
Given driver webUrlBase + '/page-04'
And switchFrame('#frame01')
When input('#eg01InputId', 'hello world')
And click('#eg01SubmitId')
Then match text('#eg01DivId') == 'hello world'
And switchFrame(null)
仅在Chrome中尝试,确保您使用的是最新版本0.9.5.RC4,如果您仍然遇到问题,请按照以下过程创建一个样本供我们复制:https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue