LambdaTestAutomation Testing ● Upload Files Using LambdaTest Selenium Grid

Upload Files Using LambdaTest Selenium Grid

In Selenium automation testing, you might have come across the need to test the upload functionality on a web app or a website. LambdaTest now allows you to work with upload file functionality on the cloud-based Selenium Grid and test the upload feature on 2000+ browser and OS combinations.

In this document, you will see how you can upload a file on the LambdaTest platform and access it via an automation test script.

How To Upload Files On LambdaTest Platform

You can upload the files on the LambdaTest cloud based Selenium Grid, using our API for uploading user-files. Follow the steps below to learn how:

  • Open LambdaTest’s API for uploading user-files

  • Click on the Lock icon to authorize your account.
  • 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.

    To get your LambdaTest Username and Access Key, visite your LambdaTest automation dashboard and click on the “key” icon, present on the top right corner.

  • Then click on the “Try it out” button.
  • 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.

    Note: The file to be uploaded must be of maximum size 15 MB and you can select up to 15 files at a time to upload on the LambdaTest platform.

Once the file is successfully uploaded, you will see a response body with 200 response code, as shown in the image below:

How To Test The Uploaded File On LambdaTest Platform

Now once the file is uploaded successfully, you can test this file on the LamnbdaTest platform, to perform automation testing on cloud-based Selenium Grid on over 2000 browser and OS combinations.

To do so, you need to first add the desired capability into your automation script for file upload.

For example: Suppose you uploaded 3 files with name “804402.png”, “file_example_JPG_2500kB.jpg”, and “Sample_File_To_Upload.txt”, then the desired capability to be added will be:






Now you can use the files uploaded for your use case in the automation test script. If the testing environment is a Windows-based OS, then the path to that file will be:

And if the environment is mac OS based, then the path will be:

For example, let’s say you want to upload a file on a web page via test script, then the sample Java code for this operation will be:

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 24/7 chat support, or you can even mail us at [email protected]

Happy Testing!