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?
Are you able to get the expected text if you interrogate the element in the Console in DevTools?
What size is the response? If you pipe the text1 to the logs - api.info() etc What is the output?
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.
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