File Uploads in Your Tests

Ghost Inspector allows to you upload files using file inputs

Search our documentation:

Toggle Documentation Menu

File Uploads in Your Tests

Ghost Inspector supports uploading files via <input type="file"> elements. If you record a test that uploads a file, you will see a notice on your test that looks like this:

File upload notice

Our test recorder cannot yet capture your files. However, we can detect the upload and give you the option to specify the file within the Ghost Inspector application. To do so, simply edit your test steps and find the step that uploads the file. Your step now includes an “Upload File…” button that allows you to include your file with the test.

File upload step

After uploading your file, the test step will display the details of your file and upload it properly when executing your test.

File upload step

The current maximum file size that Ghost Inspector allows is 10MB. However, if you need to use a large file (or prefer not to upload your file to our server), you can simply use an “Assign” step and set the value to the URL of your self-hosted file. Ghost Inspector knows when it is interacting with a <input type="file"> element. If you specify a URL, Ghost Inspector will automatically download the specified URL and upload it into the file input on the fly.