QTP读取webtable内容
我在 QTP 中有一个 WebTable,如下所示:
<TBODY>
<TR></TR>
<TR>
<TD>
<TABLE>
<TR>
<TD>
<DIV class=divRow id=divRow_d_0>
<DIV class=divFirst>1</DIV>
<DIV class=divData>toto</DIV>
<DIV class=divData>fofo</DIV>
</DIV>
<DIV class = divRow id=divRow_d_1>
<!--same structure here-->
</DIV>
</TD>
</TR>
</TABLE>
</TD>
</TR>
<TR></TR>
</TBODY>
这里,我想捕获每个 divRow 的值 divFirst 和 divData,理想情况下,将每个 divRow 存储在字符串中。
有人可以告诉我该怎么做吗?
多谢
I have a WebTable in QTP like:
<TBODY>
<TR></TR>
<TR>
<TD>
<TABLE>
<TR>
<TD>
<DIV class=divRow id=divRow_d_0>
<DIV class=divFirst>1</DIV>
<DIV class=divData>toto</DIV>
<DIV class=divData>fofo</DIV>
</DIV>
<DIV class = divRow id=divRow_d_1>
<!--same structure here-->
</DIV>
</TD>
</TR>
</TABLE>
</TD>
</TR>
<TR></TR>
</TBODY>
Here, I want to capture the values divFirst and divData for each divRow, ideally, store every divRow in a string.
Could someone please tell me how can I do that?
Thanks a lot
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这似乎有效:
我使用带有即将耗尽的索引的描述性编程的原因是
ChildObjects
不会返回这些WebElements
(显然您会想做一些事情除了带有值的 MsgBox 之外。)
This seems to work:
The reason I'm using descriptive programming with an index that will run out is that
ChildObjects
does not return theseWebElements
(Obviously you will want to do something other than MsgBox with the values.)