I've already written all the code to do most of what I said but I just don't know how to find an element. I already know the element is this:
Code: Select all
TAG POS=8 TYPE=INPUT:CHECKBOX FORM=ACTION:/pls/PROD/bwykfreg.P_AltPin1?deviceType=C ATTR=NAME:sel_crn CONTENT=YES
Code: Select all
if (element)
//if checkbox exist then select it
else
//if checkbox does not exist then refresh the page
***EDIT1***
I've found this and modified it to fit my code a little so this is what I have:
Code: Select all
int timeout = 60;
ref class ManagedGlobals {
public:
static iMacros::AppClass^ app;
};
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 CONTENT=YES", 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;
}
Does anyone know what that means?Load Failed: Failed to load the macro (syntax or I/O error) (Found wrong macro command while loading file).