attach file

Description

Attach given file(s) to a web service.

Arguments

Valid contexts

This action may be used within the following project items: test modules and user-defined actions.

Notes

Applicable Built-In Settings

The following settings are applicable to this action: remove double quotes from cells.

Uploading Files With Real World Examples

  1. Imgur

    • API-under-test: Image Upload
    • control name argument:
      • Required
      • Input value: image
    • Action lines:

  2. Imagify

    • API-under-test: Image Upload
    • control name argument:
      • Required
      • Input value: image
    • file name: Required
    • Action lines:

  3. Google Drive

    • API-under-test: Multipart Upload
    • mime type argument: When this argument is empty, the default value, applied by Google Drive, is application/x-zip
    • Action lines:

  4. Facebook

    • API-under-test: Video Upload
    • file name argument: Required
    • Action lines:

Example

Suppose that you’d like to attach a file with the following information:

  1. Path to the location of the attached file: /Users/test/Desktop/TestData/Web Services/testfile.png
  2. Value of the name attribute in the HTML input tag: file
  3. Attach the given file with a new name: file.png
  4. MIME type of the attached file: image/png
  5. The character set (character encoding) to use: UTF-8

Verify the if the HTTP status of the response is 201, which means the request has been fulfilled and resulted in a new resource being created.

Action Lines

Related concepts

Testing web services


Copyright © 2024 LogiGear Corporation. All rights reserved. LogiGear is a registered trademark, and Action Based Testing and TestArchitect are trademarks of LogiGear Corporation. All other trademarks contained herein are the property of their respective owners.

LogiGear Corporation

1730 S. Amphlett Blvd. Suite 200, San Mateo, CA 94402

Tel: +1 (650) 572-1400