Skip to content

Latest commit

 

History

History
29 lines (20 loc) · 1.08 KB

auth-scripting.md

File metadata and controls

29 lines (20 loc) · 1.08 KB

Authentication Scripting

Pre-requisites

Explanation

Sometimes the page you need to test is behind an authentication screen.

In times like that you will need to inject JS into the Authentication Script section as an IIFE.

Example script (works on Mattermost instances):

(() => {
  document.querySelector('#loginId').value = 'username';
  document.querySelector('#loginPassword').value = 'password';
  document.querySelector('#loginButton').click();
})();

And to prevent Puppeteer from attempting to run the audit before the screen has fully rendered, you must add the selector (class or id) of an element on the login screen of your website inside the Await Selector field.


Note: Providing an Await Selector value is required when using an Authentication Script. Failure to provide it will return you a validation error message from the chatbot