使用 Telerik 的 WebAii 框架测试分页
我需要找到具有特定 id 的 Span
内的每个 HtmlAnchor
:
<span id="ctl05_dpIncidentFailures">
<span>1</span> // page 1
<a href="/DesktopDefault.aspx?ptabindex=7&ptabid=31&tabindex=14&tabid=214&pageid=2">2</a>
<a href="/DesktopDefault.aspx?ptabindex=7&ptabid=31&tabindex=14&tabid=214&pageid=3">3</a>
<a href="/DesktopDefault.aspx?ptabindex=7&ptabid=31&tabindex=14&tabid=214&pageid=4">4</a>
<a href="/DesktopDefault.aspx?ptabindex=7&ptabid=31&tabindex=14&tabid=214&pageid=5">5</a>
<a href="/DesktopDefault.aspx?ptabindex=7&ptabid=31&tabindex=14&tabid=214&pageid=6">6</a>
<a href="/DesktopDefault.aspx?ptabindex=7&ptabid=31&tabindex=14&tabid=214&pageid=7">7</a>
<a href="/DesktopDefault.aspx?ptabindex=7&ptabid=31&tabindex=14&tabid=214&pageid=8">8</a>
<a href="/DesktopDefault.aspx?ptabindex=7&ptabid=31&tabindex=14&tabid=214&pageid=9">9</a>
<a href="/DesktopDefault.aspx?ptabindex=7&ptabid=31&tabindex=14&tabid=214&pageid=10">10</a>
<a href="/DesktopDefault.aspx?ptabindex=7&ptabid=31&tabindex=14&tabid=214&pageid=11">11</a>
<a href="/DesktopDefault.aspx?ptabindex=7&ptabid=31&tabindex=14&tabid=214&pageid=12">12</a>
<a href="/DesktopDefault.aspx?ptabindex=7&ptabid=31&tabindex=14&tabid=214&pageid=13">13</a>
</span>
我如何使用 WebAii 来做到这一点?这是我到目前为止所尝试过的:
IList<Element> allbtns = Find.AllByAttributes("href=~pageid"); // not working
var _pagingList = Find.ById<HtmlSpan>("~dpIncidentFailures"); // not working either
I need to find every HtmlAnchor
inside a Span
with a specific id:
<span id="ctl05_dpIncidentFailures">
<span>1</span> // page 1
<a href="/DesktopDefault.aspx?ptabindex=7&ptabid=31&tabindex=14&tabid=214&pageid=2">2</a>
<a href="/DesktopDefault.aspx?ptabindex=7&ptabid=31&tabindex=14&tabid=214&pageid=3">3</a>
<a href="/DesktopDefault.aspx?ptabindex=7&ptabid=31&tabindex=14&tabid=214&pageid=4">4</a>
<a href="/DesktopDefault.aspx?ptabindex=7&ptabid=31&tabindex=14&tabid=214&pageid=5">5</a>
<a href="/DesktopDefault.aspx?ptabindex=7&ptabid=31&tabindex=14&tabid=214&pageid=6">6</a>
<a href="/DesktopDefault.aspx?ptabindex=7&ptabid=31&tabindex=14&tabid=214&pageid=7">7</a>
<a href="/DesktopDefault.aspx?ptabindex=7&ptabid=31&tabindex=14&tabid=214&pageid=8">8</a>
<a href="/DesktopDefault.aspx?ptabindex=7&ptabid=31&tabindex=14&tabid=214&pageid=9">9</a>
<a href="/DesktopDefault.aspx?ptabindex=7&ptabid=31&tabindex=14&tabid=214&pageid=10">10</a>
<a href="/DesktopDefault.aspx?ptabindex=7&ptabid=31&tabindex=14&tabid=214&pageid=11">11</a>
<a href="/DesktopDefault.aspx?ptabindex=7&ptabid=31&tabindex=14&tabid=214&pageid=12">12</a>
<a href="/DesktopDefault.aspx?ptabindex=7&ptabid=31&tabindex=14&tabid=214&pageid=13">13</a>
</span>
How could I do this using WebAii? This is what I have tried up to now:
IList<Element> allbtns = Find.AllByAttributes("href=~pageid"); // not working
var _pagingList = Find.ById<HtmlSpan>("~dpIncidentFailures"); // not working either
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我已经解决了我的问题:
I have solved my issue: