I have a question about how to API key to get a test case information.
- Created and saved an API key from TestRail website.
- Downloaded testrail.py and put it under the project root folder
- Got an error when I tried to run my script to send a request.
Screenshot of the script
Traceback (most recent call last):
File “script.py”, line 7, in
case = client.send_get(‘get_case/1’)
File “D:\python_test\testrail.py”, line 42, in send_get
return self.__send_request(‘GET’, uri, filepath)
File “D:\python_test\testrail.py”, line 65, in __send_request
auth = base64.b64encode(’%s:%s’ % (self.user, self.password))
File “C:\Users\eric.yun\AppData\Local\Programs\Python\Python37-32\lib\base64.py”, line 58, in b64encode
encoded = binascii.b2a_base64(s, newline=False)
TypeError: a bytes-like object is required, not ‘str’