使用sahi进行自动化期间Web浏览器中对象的运行时更改

时间:2015-04-23 07:22:47

标签: javascript html automation sahi

我使用Sahi作为自动化工具但我在识别其中一个字段时遇到问题。字段在运行时被更改,我无法捕获它。 我在这里附上图片。 “读取”和“跳过”字段均由以下属性标识:

读取

_div("0[1]")
  _div("cell-right fg-000000[1]")
    _div(613)

跳过

_div("0")
  _div("cell-right fg-000000")
    _div(615)

然而,数组[1]进行交换,每次执行脚本时我都会收到以下错误。

_sahi.setServerVarForFetch('___lastValue___1429772452227', _getText(_div("cell-right fg-000000[1]"))); [9205 ms] [12:31:00.321]
Error: The parameter passed to _getText was not found on the browser
at: (C:\sahi_pro\userdata\scripts\TLMRP.sah&n=40) checkFileExist

请帮助确定如何识别。

1 个答案:

答案 0 :(得分:0)

如果我理解正确并且您只是有一个id正在改变的字段,请使用正则表达式来获取它

_div(/fg-000000/)