0
我正在编写C++ iMacro脚本,该脚本将登录到网站,转到特定页面并查找复选框。如果复选框不存在,那么该脚本将每隔X秒刷新页面。如果复选框确实存在,那么它会选择它。基本上我只需要弄清楚如何让iMacro搜索复选框。这里是我到目前为止的代码:iMacro查找元素
using namespace System;
#include <string>
int timeout = 60;
ref class ManagedGlobals {
public:
static iMacros::AppClass^ app;
};
// test if element exists
bool doesElementExist() {
iMacros::Status stat;
ManagedGlobals::app->iimDisplay("Searching for element", timeout);
stat = ManagedGlobals::app->iimPlay("CODE:SET !TIMEOUT_TAG 1\n"
+ "CODE:TAG POS=8 TYPE=INPUT:CHECKBOX FORM=ACTION:/pls/PROD/bwykfreg.P_AltPin1?deviceType=C ATTR=NAME:sel_crn EXTRACT=TXT", timeout);
ManagedGlobals::app->iimDisplay(stat.ToString(), timeout);
ManagedGlobals::app->iimPlay("CODE:WAIT SECONDS=10", timeout);
if (stat != iMacros::Status::sOk) {
ManagedGlobals::app->iimDisplay("Didn't find it", timeout);
return false;
}
ManagedGlobals::app->iimDisplay("Found it", timeout);
return true;
}
我已经在页面上测试了这一点,该复选框确实存在,但剧本是无法找到它,而是返回错误代码-1100其根据this page这意味着Load Failed: Failed to load the macro (syntax or I/O error) (Found wrong macro command while loading file).
任何人都知道问题是什么?