Javascript 在使用sahi进行自动化期间Web浏览器中对象的运行时更改
我正在使用Sahi作为自动化工具,但我在识别其中一个字段时遇到问题。该字段在运行时被更改,我无法捕获它。 我在这里附上图片。 读取和跳过的字段均由以下属性标识: 阅读Javascript 在使用sahi进行自动化期间Web浏览器中对象的运行时更改,javascript,html,automation,sahi,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) 跳过 _div("0[1]") _div("cell-right fg-000000[1]"
_div("0[1]")
_div("cell-right fg-000000[1]")
_div(613)
_div("0")
_div("cell-right fg-000000")
_div(615)
跳过
_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
请帮助我如何识别相同的字段。如果我理解正确,而您只有这个id正在更改的字段,请使用正则表达式获取它
_div(/fg-000000/)
您能否提供html页面的图像,其中包含这些元素?还是该页面的链接?如果你不能在这里上传图片,你可以使用imgur。如果您想自己尝试,请查看类似_near的API_在等中,这些将帮助您根据上下文或对其他元素的引用来识别元素。如果你能提供图像,我可以告诉你使用的确切代码。另外,您使用的是哪个版本的sahi?