Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Importing test library 'RequestsLibrary' failed: ImportError: No module named RequestsLibrary Traceback

I am hitting HTTP service using Robot. But it is showing me the following issues

  1. No keyword with name 'Create Session' found.

  2. Importing test library 'RequestsLibrary' failed: ImportError: No module named RequestsLibrary Traceback (most recent call last):

I have installed RequestsLibrary. My TC is:

*** Settings ***
Library  Collections
Library  String
#Library  RequestsLibrary
Library  OperatingSystem
Library    ExtendedRequestsLibrary
Suite    Teardown  Delete All Sessions

*** Test Cases ***
Get Requests
    [Tags]  get
    Create Session  google  http://www.google.com
#    Create Session  github  https://api.github.com

    ${resp}=  Get  google  /
    Should Be Equal As Strings  ${resp.status_code}  200

    ${resp}=  Get  github  /users/bulkan
    Should Be Equal As Strings  ${resp.status_code}  200
    Dictionary Should Contain Value  ${resp.json()}  Bulkan Evcimen
like image 201
Vishal Pachpute Avatar asked Dec 20 '16 08:12

Vishal Pachpute


1 Answers

The error is that the RequestLibrary is not installed, but the source you've posted actually imports ExtendedRequestsLibrary. You need to have it installed:

pip install robotframework-extendedrequestslibrary

The command to install RequestLibrary - the one that is commented - is:

pip install robotframework-requests

As the library (libraries) were not installed, you got the first error - the Create Session is defined in them, and w/o the library Robot Framework does not find it.

like image 97
Todor Minakov Avatar answered Nov 14 '22 09:11

Todor Minakov