Skip to main content
prerunUpload pre run executable file to our lambda storage
TestMu AI
StatusCommunityBlog
prerun

Upload pre run executable file to our lambda storage

In order to use pre run feature you first need to upload your relevant script files to our lambda storage. For every pre run action you need to upload 2 scripts (Pre run file and Post run file). Pre run file will be executed before starting the test and post run file will be executed after test is completed. If you perform any changes in test machine like changing host file, changing windows registry key, installing certificates, then your post run file should undo those changes

POST
/files
Upload pre run executable file to our lambda storage
curl --request POST \
--url "https://api.lambdatest.com/automation/api/v1/files" \
--header "Authorization: Basic <encoded-value>" \
--header "Content-Type: multipart/form-data" \
--form 'pre_run_file=<pre_run_file>' \
--form 'name=<name>' \
--form 'post_run_file=<post_run_file>'
{
"data": [
{
"file": "httpdialog.au3",
"error": ""
}
],
"message": "Files have been uploaded successfully to our lambda storage",
"status": "success"
}

Authorizations

Authorizationstringheaderrequired

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Body

multipart/form-data

To upload a new pre run executable files

pre_run_filestring<binary>required

If your script requires some reference to other file that needs to be present in our machines then you can upload multiple pre_run_file and download those files in your script using download API

namestringrequired

Name of your pre run executable

post_run_filestring<binary>required

script file that will revert the actions performed by pre run file. If there is no post action that needs to performed then you can upload an empty file

Response

application/json

Successful operation

dataobject[]
data.filestring
Example: "httpdialog.au3"
data.errorstring
Example: ""
messagestring
statusstring
Upload pre run executable file to our lambda storage
curl --request POST \
--url "https://api.lambdatest.com/automation/api/v1/files" \
--header "Authorization: Basic <encoded-value>" \
--header "Content-Type: multipart/form-data" \
--form 'pre_run_file=<pre_run_file>' \
--form 'name=<name>' \
--form 'post_run_file=<post_run_file>'
{
"data": [
{
"file": "httpdialog.au3",
"error": ""
}
],
"message": "Files have been uploaded successfully to our lambda storage",
"status": "success"
}