Page 1 of 1

Monitoring Javascript HTML pages from plugin

Posted: Mon Feb 26, 2024 1:45 pm
by wneville
Hello,

Is there an official plugin that monitors webpages running Javascript HTML? I am looking to monitor about 700 urls for my colleagues. When I run check_http on these URLs, they return 200 OK regardless of the URL extension and the body says "You need to enable JavaScript to run this app."

For example, one of the URL extensions is .../summary/11 - the returned HTML says:

Code: Select all

   
    <title>Workflows</title>
  </head>
  <body>
    <noscript>You need to enable JavaScript to run this app.</noscript>
    <div id="root"></div>
    <!--
      This HTML file is a template.
      If you open it directly in the browser, you will see an empty page.

      You can add webfonts, meta tags, or analytics to this file.
      The build step will place the bundled scripts into the <body> tag.

      To begin the development, run `npm start` or `yarn start`.
      To create a production bundle, use `npm run build` or `yarn build`.
    -->
(note: when I open this page in a browser, it loads content; it is not an empty page)

When I enter ..../summary/bad-extension, I get the same HTML response - I am not sure why the bad-extension URL isn't giving a 404

Could I use the webinject script for this? I am not positive but I think this might be deprecated? Any other insights into how I might monitor the content of these pages, or accurately retrieve HTTP status codes, is greatly appreciated.

Re: Monitoring Javascript HTML pages from plugin

Posted: Tue Feb 27, 2024 10:27 am
by lgute
Hi @wneville, thanks for reaching out.

This post may help you, viewtopic.php?t=62069

Re: Monitoring Javascript HTML pages from plugin

Posted: Wed Feb 28, 2024 9:53 am
by wneville
Thanks Laura,

Unfortunately I'm not sure if either solution from the other forum thread will work here. From the post you linked: "webinject doesn't run the javascript on the page, you can post and read returned information but it won't run the javascript." Not only this but the URLs I am looking to monitor are deployed within a VPC which appears to be blocking webinject :(

Selenium was the alternative suggested, I don't think it is possible to deploy NCPA to the VPC so I might be out of luck

Re: Monitoring Javascript HTML pages from plugin

Posted: Wed Feb 28, 2024 3:57 pm
by jmichaelson
You may want to have a look at something like Cypress (https://www.cypress.io/). Its similar to Selenium, in that its a web testing framework. I'm only suggesting it as I'm far mora familiar with it. You may have to set up a separate system that you could run the testing framework on which would execute the javascript as though it were running in a browser (because under Cypress, at least, it is). Set up an automated test for whatever you're expecting to load on the page, and report the status of the test back as the result.