Netsparker.: Click (El, Delay)
Netsparker.: Click (El, Delay)
auth
Contains form authentication helper methods.
Methods
click(el, delayopt)
Parameters:
delay number <optional> The number of milliseconds (thousandths of a second) that the click should be delayed by. Note
that all delays are timed from the beginning of the script execution and does not work in
sequence if you have several function calls with delay.
Example
// Click element by id
netsparker.auth.click('LoginButton');
// Click element by id after 2 seconds
netsparker.auth.click('LoginButton', 2000);
// Click element by DOM element reference
netsparker.auth.click(document.getElementsByTagName('BUTTON')[0]);
clickByQuery(query, delayopt)
Parameters:
delay number <optional> The number of milliseconds (thousandths of a second) that the click should be delayed by. Note that all
delays are timed from the beginning of the script execution and does not work in sequence if you have
several function calls with delay.
Example
// Click element by using a complex CSS query
netsparker.auth.clickByQuery('#loginForm > div:nth‐child(2) > button');
// Click element by id
netsparker.auth.clickByQuery('#LoginButton');
// Click element by id after 2 seconds
netsparker.auth.clickByQuery('#LoginButton', 2000);
executeInFrame(frameEl, code, delayopt)
Parameters:
delay number <optional> The number of milliseconds (thousandths of a second) that the code execution should be
delayed by. Note that all delays are timed from the beginning of the script execution and does
not work in sequence if you have several function calls with delay.
Example
// Clicks an element inside a frame
var frame = document.getElementsByTagName('IFRAME')[1];
netsparker.auth.executeInFrame(frame, 'netsparker.auth.click("LoginButton");');
log(message)
Logs a message.
Parameters:
Example
// Log a simple message
netsparker.auth.log('Hello world!');
login(usernameopt, passwordopt, delayopt)
Parameters:
delay number <optional> The number of milliseconds (thousandths of a second) that the login should be delayed by. Note
that all delays are timed from the beginning of the script execution and does not work in sequence
if you have several function calls with delay.
Example
// Login using hard‐coded values
netsparker.auth.login('john.doe', 'p4ssw0rd');
// Login using hard‐coded values after 2 seconds
netsparker.auth.login('john.doe', 'p4ssw0rd', 2000);
// Login using implicit credentials (current persona)
netsparker.auth.login();
// Login using implicit credentials (current persona) after 2 seconds
netsparker.auth.login(2000);
setInputValue(el, value, delayopt)
Parameters:
delay number <optional> The number of milliseconds (thousandths of a second) that this set value operation should be
delayed by. Note that all delays are timed from the beginning of the script execution and does
not work in sequence if you have several function calls with delay.
Example
// Set value by id
netsparker.auth.setInputValue('Username', 'john.doe');
// Set value after 2 seconds
netsparker.auth.setInputValue('Username', 'john.doe', 2000);
// Set value by DOM element reference
netsparker.auth.setInputValue(document.forms[0].elements[0], 'john.doe');
setValueByQuery(query, value, delayopt)
Finds input element using the CSS query and sets its value.
Parameters:
delay number <optional> The number of milliseconds (thousandths of a second) that this set value operation should be delayed
by. Note that all delays are timed from the beginning of the script execution and does not work in
sequence if you have several function calls with delay.
Example
// Query complex paths
netsparker.auth.setValueByQuery('#loginForm > div:nth‐child(2) > input', 'john.doe');
// Query by id
netsparker.auth.setValueByQuery('#Username', 'john.doe');
// Set value after 2 seconds
netsparker.auth.setValueByQuery('#Username', 'john.doe', 2000);