【发布时间】:2015-11-24 22:01:10
【问题描述】:
我正在尝试使用 UI 测试点击 WKWebView 中的链接。链接定义如下:
<a data-toggle="tab" href="#haloLogin">
<img src=/Images/Halo_small.png">
</a>
我可以像这样找到链接:
let haloLink = app.links.elementBoundByIndex(1)
(索引 0 处还有另一个链接)
这是我打印出 haloLink.debugDescription 时得到的:
haloLink: Attributes: Link 0x1257094e0: traits: 146029019138, {{143.0, -392.0}, {32.0, 32.0}}
Element subtree:
→Link 0x1257094e0: traits: 146029019138, {{143.0, -392.0}, {32.0, 32.0}}
Image 0x125709cf0: traits: 146029019142, {{143.0, -392.0}, {32.0, 32.0}}
我尝试过使用
app.links["#haloLogin"]
没有成功。
我的问题是我没有得到
haloLink.tap()
上班。
欢迎提出任何建议!
【问题讨论】:
标签: ios xcode wkwebview xcode-ui-testing