I am NOT AC support, just a guy trying to help...
Hope it helps,
cw
One possible problem is that your "if" statement in your first RUN SCRIPT (see bottom of this message) is not in the proper format.
It is missing the opening and closing brackets and the instructions contained within the brackets that are supposed to
take place if the "if" results is true (truthy).
Because of that improper 'if' statement, everything that follows will be improperly executed, or not executed at all.
Also, you may want to change your trigger to "Tab load begins" by selecting "A tab starts loading a page" in the dropdown "events" list.
Also, you may want to place a checkmark into the "Run Asynchronously" box on the RUN SCRIPT item.
Redo your RUN SCRIPT code and see what happens. Maybe with something like this:
// ----------------
// Run Script code
// ----------------
function getElementByXPath(path) {
try {
return document.evaluate(path, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
} catch(ex) {
alert(ex.message);
}
}
$(document).ready(async function() {
// - OR -
// $(async function() {}); // <-- A short version of '$(document).ready'
// $(document).ready JQUERY HELP->
https://api.jquery.com/ready/ try {
// ---------------------------------
// Do what you want to do from here
// ---------------------------------
if (!getElementByXPath("//div[contains(@class,'error')]")) {
// - OR -
// if(!document.querySelector('div.error')) {
// - OR -
// if(!document.querySelector('div[class="error"]')) {
return ACtl.STOP_CHAIN;
} else {
await ACtl.sleep(1000);
ACtl.openURL('
TEST.COM', '#currentTab');
}
} catch (ex) {
alert(ex.message);
}
}); // $(document).ready(async function() {
// End of Code
-----------------------------------------------------------------------------------
HERE IS YOUR CURRENT "RUN SCRIPT" CONTENTS:
-----------------------------------------------------------------------------------
function getElementByXPath(path) {
return document.evaluate(path, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue
}
if ( !getElementByXPath("//div[contains(@class,'error')]"))
return ACtl.STOP_CHAIN ;
await ACtl.sleep(1000)
ACtl.openURL('
TEST.COM', '#currentTab') ;
-----------------------------------------------------------------------------------