From cdf74dc5b41150aa5def24a999b2928d3d110f50 Mon Sep 17 00:00:00 2001 From: tejasa Date: Mon, 7 Jul 2025 18:49:30 +0530 Subject: [PATCH 1/2] Download hook while execution --- docs/upload-files-using-lambdatest.md | 33 +++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/docs/upload-files-using-lambdatest.md b/docs/upload-files-using-lambdatest.md index 312ac1a2a..9de10de71 100644 --- a/docs/upload-files-using-lambdatest.md +++ b/docs/upload-files-using-lambdatest.md @@ -55,15 +55,15 @@ You can upload the files on the LambdaTest cloud based Selenium Grid, using our * Click on the Lock icon to authorize your account. lock icon] * Enter your LambdaTest username and access key, in the box that appears, to validate your credentials. Once done, click on the "Authorise button to verify the credentials, and click on Close to close the window. authorize button -> -To get your LambdaTest Username and Access Key, visite your [LambdaTest automation dashboard](https://automation.lambdatest.com/) and click on the "key" icon, present on the top right corner. + +> To get your LambdaTest Username and Access Key, visite your [LambdaTest automation dashboard](https://automation.lambdatest.com/) and click on the "key" icon, present on the top right corner. automation key * Then click on the "Try it out" button. choose file * Once your authorization is successful and you click on the Try it out button, an option to select the file will appear on your screen. Choose the file to be uploaded using the "Choose File" button and click on Execute to upload it on the LambdaTest platform. 200 status code -> -**Note**: You can upload multiple files to our lambda storage. A maximum of 150 files can be uploaded per organization. We have limit of 20 MB files size per API. So if you are total file sizes reach the limit, please upload your files in multiple API calls. + +> **Note**: You can upload multiple files to our lambda storage. A maximum of 150 files can be uploaded per organization. We have limit of 20 MB files size per API. So if you are total file sizes reach the limit, please upload your files in multiple API calls. Once the file is successfully uploaded, you will see a response body with 200 response code, as shown in the image below: upload file @@ -169,7 +169,30 @@ For example, let's say you want to upload a file on a web page via test script, ``` * * * -> + +# Download Files from LambdaTest Storage while test execution + +During Selenium automation testing, there are scenarios where you need to retrieve files from LambdaTest's cloud storage directly to the machine running your test. LambdaTest provides a download hook that enables you to fetch files from lambda storage seamlessly during test execution. + + +Before using the download hook, ensure that: +- Files are already uploaded to LambdaTest storage using the [file upload API](https://www.lambdatest.com/support/api-doc/) +- You have the exact file names stored in lambda storage + +## Download Hook Implementation + +### Basic Syntax + +The download hook uses a simple executeScript command to fetch files from lambda storage: + +``` +driver.executeScript("lambda-files-download=file_name") +``` + + + +* * * + That's it! You can now successfully upload files and use them with Selenium Automation testing on LambdaTest's cloud server. If you face any issues, please feel free to reach out to us via our  window.openLTChatWidget()}>**24/7 chat support**, or you can even mail us at [support@lambdatest.com](mailto:support@lambdatest.com)
Happy Testing!