|
本人想取HtmlTable 中数据,但GetRowText 与GetRowCount都失效,取不出数据,打算用DOM取值
HTMLTABLE原码:
[ ] <TABLE id=DataTable_ListView ondblclick="TableRowSet_OnDbClick('ListView');" style="TABLE-LAYOUT: fixed; BORDER-COLLAPSE: collapse" onfocusout="TableRowSet_OnFocusOut('ListView');" onclick="TableRowSet_OnClick('ListView');" borderColor=#000000 width=1500 bgColor=#fafcff border=1 DBGridPK="ListView" name="DataTable_ListView" pageCount="1" currPage="1">
[ ] <TBODY class=G-TableBody>
[ ] <TR class=GD-Two height=20 I="" M_STRIMAGEINDEX_DISPLAY="0" M_STRIMAGEINDEX="0">
[ ] <TD class=GD-TD width=100>50050</TD>
[ ] <TD class=GD-TD width=100>测试信用社</TD>
[ ] <TD class=GD-TD width=100 I="10">[10]信用社 </TD>
[ ] <TD class=GD-TD width=100>3333333333</TD>
[ ] <TD class=GD-TD width=100>1234</TD></TR></TBODY></TABLE>
在脚本中定义一个JS脚本放到LIST中,如下:
[-] LIST OF STRING lsLines = {...}
[ ] " function test() "{"
[ ] " table = document.getElementById('DataTable_ListView');"
[ ] " trs = table.getElementsByTagName('tr');"
[ ] " result = "";"
[ ] "for(var i=0; i<trs.length; i++)"
[ ] ""{"
[ ] " tds = trs.getElementsByTagName('td');"
[ ] "for(var j=0; j<tds.length; j++)"
[ ] ""{"
[ ] "result += tds[j].innerText + ';' ;"
[ ] "};"
[ ] "};"
[ ] "return result;"
[ ] "};"
[ ]
信息系统维护3.SetActive()
string bb=信息系统维护3.ExecScript(lsLines) --在这一步就报错了!
Print (信息系统维护3.ExecFunction("test"))
执行报错,
[-] Testcase 税局信息系统维护_01 - 1 error
[ ] *** Error: DLL cannot be loaded -- Error 126
[ ] Occurred in ai_CaptureScreen
[ ] Called from LogCase at ai_fun.inc(617)
从调试过程来看,JS写错了,但不知道在silktest对js脚本的要求是怎么样的,哪位高手帮忙看看是哪里的问题 |
|