User2014
User2014

Reputation: 101

How to add 'HttpLibrary' from RobotFramework to Red.xml on Eclipse

I trying to write test scripts using HttpLibrary (from robot framework) on Eclipse RED editor and below are the steps i have performed -

Steps performed

  1. Installed robot framework HttpLibrary using below command

pip install --upgrade robotframework-httplibrary

  1. From Settings-> Imports, added HttpLibrary to my script

* Settings * Library HttpLibrary

  1. 'Unknown 'HttpLibrary' library. Try to use Quick Fix (Ctrl+1) or add library to red.xml for proper validation' error message is noticed on hovering the HttpLibrary line in my script.

  2. However upon looking at Red.xml ->Referenced libraries tab, HttpLibrary is listed in the libraries block HttpLibrary in Red.xml

I am wondering if there is any different procedure to add libraries to Red.xml. I am stuck on trying different ways to add HttpLibrary to my script.

Upvotes: 0

Views: 3290

Answers (2)

A. Kootstra
A. Kootstra

Reputation: 6981

This occasionally happens. Even when the library is already present in the project config file (RED.xml) and present in the project tree panel. Using CTR+1 and opting for the quick fix option will generally correct this issue without any visual difference.

In the HttpLibrary Github documentation there the usage section also highlights that the library should be imported like:

*** Settings*** 
Library    HttpLibrary.HTTP

This gives a different result.

Upvotes: 0

User2014
User2014

Reputation: 101

After few hours of investigation, i have found root cause of the issue. I am using Python 3.6.4 in my machine and installed Robot Framework on it. HttpLibrary supports only Python 2 and so though the library is listed in the Red.xml referenced libraries tab, still my Robot Framework script was not able to reference and run it properly. Please note that not all the Robot Framework libraries are supported by Python 3.6.4

Upvotes: 2

Related Questions