19 Dec 2022
03:38 PM
- last edited on
20 Dec 2022
08:43 AM
by
MaciejNeumann
Hi, I'm attempting to add some javascript to a clickpath to extract the text from an XML Page. I have this working with another clickpath using:
var text = 'An error occured';
var text1 = document.documentElement.innerText;
if (text1.match(/An error occurred/)) {
api.skipNextSyntheticEvent();
} else {
api.info("AUP found");
}
The issue i have is the line:
var text1 = document.documentElement.innerText;
times out when loading the XML Page (JS execution took too long). i've tried innerHTML but this also times out. Is it possible for a click path to do what i want on an XML page?
Hi Hannah,
when i put that in dev tools console i get the text of the page displayed as expected. its 4255 characters long. I've attempted to pipe to api.info and even to api.fail but the script does not reach that point. If the script only contains var text1 = document.documentElement.innerText; it still times out.
Interesting. Can you go into chat so we can look at this?
The chat functionailty in the WebUI. That way we can looks at the monitor and page and see what's happening. If you do not have access to chat, you can create a Support ticket
we dont have chat so i've created a ticket #111989
Looks like any javascript action times out following the navigation to the XML page. even just
api.info("step 4");
or
api.fail("step 4");
What version ActiveGate are you running this on? There was a similar sounding issue a while ago, but that was fixed around 1.229.
Ah, ok. Unfortunately, there was no workaround and upgrading was the only solution. 😞
OK, I shall see how it goes when we are updated in the new year. thanks for the help