aisingapore / TagUI

Free RPA tool by AI Singapore
Apache License 2.0
5.6k stars 580 forks source link

请教下对于打开页面有没有办法监听加载完成后再执行操作?- use timeout #1377

Closed 15295739756 closed 1 month ago

15295739756 commented 4 months ago

具体例子如下 popup xxx frame mainFrame click //*[@id="123"]

这种情况下,如果xxx加载较长,导致后面找不到元素,我看解决方案有的是加wait 2这种,但是这种如果页面加载久了还是不行,不想写死。第二种我看有exist('//[@id="123"]') 类似于下面这种,实际尝试也没用。 popup xxx frame mainFrame if exist('//[@id="123"]') click //*[@id="123"]

请教下还有别的办法吗?

kensoh commented 1 month ago

Hi @15295739756 is the loading slow for the popup page? Does the error show error at element 123 or the mainFrame or the popup page?

If it is for the element 123, you can increase timeout from default 10 seconds to longer, for eg 300 for 5 minutes -

https://tagui.readthedocs.io/en/latest/reference.html#timeout

Then TagUI will keep waiting and trying for 5 minutes until it appears.