[Python] HTTPBasicAuth.__init__() takes 3 positional arguments but 50 were given

Discussão em 'Python' iniciado por Stack, Setembro 9, 2024.

  1. Stack

    Stack Membro Participativo

    This is my code for a basic Authentication

    *** Settings ***
    Library RequestsLibrary

    *** Variables ***
    ${BASE_URL} BASE_URL
    ${USERNAME} USERNAME
    ${PASSWORD} PASSWORD
    ${CONTENT_TYPE} application/x-www-form-urlencoded
    ${GRANT_TYPE} grant_type=client_credentials

    *** Test Cases ***
    Send POST Request with Basic Auth
    [Tags] api
    Create Session mysession ${BASE_URL} auth=${USERNAME}:${PASSWORD}
    ${headers}= Create Dictionary Content-Type=${CONTENT_TYPE}


    ${response}= Post Request mysession / data=${GRANT_TYPE} headers=${headers}

    Log ${response.status_code}
    Log ${response.Content}


    This issur apear HTTPBasicAuth.init() takes 3 positional arguments but 50 were given.

    Could You help me please?

    actual result:

    HTTPBasicAuth.__init__() takes 3 positional arguments but 50 were given

    Continue reading...

Compartilhe esta Página