Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Robot Framework test scripts fail with SSLError

I have written Robot Framework test scripts in .tsv format to test web-services/APIs. Everything was working fine until today (probably because of the new updates of Robot Framework) when I started to get the following error:

SSLError: ("bad handshake: SysCallError(-1, 'Unexpected EOF')",)

This error keeps popping up for the following code in a test script:

${headers}=  Create Dictionary Content-Type application/json  Accept application/json
RequestsKeywords.Get Request httpbin ${url} headers=${headers} //ERROR SHOWS FOR THIS STATEMENT

I did get a detailed traceback for this error which is as follows:

Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/RequestsLibrary/RequestsKeywords.py", line 298, in get_request
    session, uri, params, headers, redir, timeout)
  File "/Library/Python/2.7/site-packages/RequestsLibrary/RequestsKeywords.py", line 801, in _get_request
    cookies=self.cookies)
  File "/Library/Python/2.7/site-packages/requests/sessions.py", line 480, in get
    return self.request('GET', url, **kwargs)
  File "/Library/Python/2.7/site-packages/requests/sessions.py", line 468, in request
    resp = self.send(prep, **send_kwargs)
  File "/Library/Python/2.7/site-packages/requests/sessions.py", line 576, in send
    r = adapter.send(request, **kwargs)
  File "/Library/Python/2.7/site-packages/requests/adapters.py", line 447, in send
    raise SSLError(e, request=request)

My system configuration:

Mac OS X (10.11.3)
Python (2.7.10)
openssl (1.0.2f)
requests (2.9.1)
robotframework (3.0)
robotframework-httplibrary (0.4.2)
robotframework-requests (0.4.4)
robotframework-ride (1.5.2.1)
robotframework-sshlibrary (2.1.2)
pyOpenSSL (0.15.1)

How do I resolve this issue?

like image 423
giri-sh Avatar asked Mar 01 '16 15:03

giri-sh


People also ask

What is Robot Framework ride?

Ride is the Integrated Development Environment for Robot Framework. An Integrated Development Environment (IDE) is a software application that provides comprehensive facilities to computer programmers basically for writing and debugging code.

What is the use of Robot Framework?

Robot Framework is a generic, Python-based, open-source automation framework. It can be used for test automation and robotic process automation (RPA). Robot Framework is supported by Robot Framework Foundation. Many industry-leading companies use the tool in their software development.

What is Robot Framework in Python?

Robot Framework is a common open-source automation framework for Acceptance Testing, Acceptance Test-Driven Development (ATTD), and Robotic Process Automation (RPA). It uses a keyword-driven testing technology approach and the capabilities can be extended by testing libraries that can be implemented in Python or Java.


2 Answers

You're all up to date, so there are two possibilities:

  • The handshake isn't going smoothly because of a break in the trust chain. Start from the bottom and work up. Are you testing this on a local area network? Is the certificate up to date? Can you access the site from your location and others without an error? SSL labs showing anything up? What about firewall rules?
  • There's a bug in the recent update. OpenSSL reports in my experience are caused by connection issues rather than obscure software problems - this is the less likely of the two.
like image 125
L Martin Avatar answered Sep 21 '22 04:09

L Martin


Try installing requests[security] instead of requests. It uses PyOpenSSL, which is better than OpenSSL: pip install requests[security] vs pip install requests: Difference

like image 31
fodma1 Avatar answered Sep 23 '22 04:09

fodma1