I am to load test a scenario where user adds a contact in his addressbook. To do this user must first Log-In to his account.
I have a Nodejs script 'AutoLogin.js' that performs Log-In for the user and a json file 'contact.json' which has necessary configuration and POST request parameters to add contact in addressbook.
Artillery runs 'contact.json' file.
{
"config": {
"target": "target url",
"https": {
"tls": {
"rejectunauthorized": false
}
},
"phases": [
{
"duration": 10,
"arrivalRate": 2
}
]
},
"scenarios": [
{
"flow": [
{
"post": {
"url": "/addContact",
"contactInfo": {
"Name": "Davion",
"Mobile": "9289543654",
"Email": "Davion@gmail.com"
}
}
}
]
}
]
}
Given code sends 2 Post request/sec i.e simulating 20 users adding a contact to addressbook over a duration of 10 seconds.
I need to perform Log-In before this code runs as adding a contact without Log-In is not possible.
Plus I don't want Log-In process to be included in load test. Is there a way I Can run my 'AutoLogin.js' script within 'contact.json' file without including it in load test and then running 'contact.json' using Artillery?