'PermissionError: [Errno 13] Permission denied: 'C:/Pho to.png' in Robot Framework
*** Settings ***
Library Collections
Library RequestsLibrary
Library OperatingSystem
*** Variables ***
${base_url} https://petstore.swagger.io/v2/swagger.json
${id} 1
*** Test Cases ***
Upload_Image
create session mysession ${base_url}
${data} Evaluate {'file': ('Photo.png', open("C:/Photo.png", 'r+b'), 'image/png'), 'additionalMetadata': (none, cat)}
${Header} create dictionary Content-Type=multipart/form-data boundary
${response} POST On Session mysession /pet/{petId}/uploadImage/${id} data=${data} headers=${Header}
log to console ${response.status_code}
I was trying to api testing of uploading photo and i encountered PermissionError: [Errno 13] Permission denied: 'C:/Photo.png'
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
