Imap lIbrary unable to recognize keywords

Hi all ,
I recently installe Imap library2 and trying out simple examples

Open Mailbox… user=skjdhfjksdhjkf password=skjdhfkjdshf
Close Mailbox

on executing I am getting :slight_smile: Test case contains no keywords.
on pip list : i could find the library name but still it doesnot finds the keywords.

I know it might seem obvious but I’ll ask anyway… do you have the Library line below in the settings section of your robot file?

*** Settings ***
Library    ImapLibrary

That would be the most obvious answer to why you are getting this error.

HI Damies , yes offcourse , some of the other solution also described as using Imaplibrary2 i used the same but still same result.

Great, just wanted to get the obvious out of the way :+1:

Can you run

robot --version


pip -V

just to check pip and robot are both using the same python version (I once had an issue where there were pip was python 3.7 and robot was using python 3.4 and so robot couldn’t see the libraries installed with pip.

pip 20.2.3
Robot Framework 3.1.2 (Python 3.8.1 on win32)

i have the updated version of Imap

not the pip version the python version that pip is using on mine it shows at the end of the line in brackets

pip 20.2.3 from /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip (python 3.9)

Pip version (python 3.8)

did the updated version of Imap help? :crossed_fingers:

NO same problem , I have installed other lib like selenium Lib with same version of pip and robot and it works Fine

Sorry if it seems i’m asking silly questions, I’ve never used the Imap library, so i’m just following basic troubleshooting hoping it helps you :crossed_fingers:

did you get something like this in your log? I’m guessing not or you would have mentioned it:

Importing test library 'ImapLibrary' failed

the next question is: is there at least 1 tab or 2 spaces in front of Open Mailbox and Close Mailbox

Like this:

imap test 1
	Open Mailbox…  user=skjdhfjksdhjkf  password=skjdhfkjdshf
	Close Mailbox

Not like this (This will cause “Test case contains no keywords” regardless which library you use):

imap test 2
Open Mailbox…  user=skjdhfjksdhjkf  password=skjdhfkjdshf
Close Mailbox


Hi Dave,
I can confirm i am following the normal tabs between the keywords, and no i dont get this msg on my terminal importing failed

One thing i noticed in the docs for Open Mailbox, there is no option for server= only host=
try changing to

I would expect you to have a different error if this was the issue but worth a try

Yes This is something i marked it , tried also but it doesnt even go till there , same result no keywords found

I had a quick look through the issues for robot framework, there was some issues with importing some libraries in robotframework v3.1 and I noticed you are using Robot Framework 3.1.2, I have Robot Framework 3.2.2, so it might be worth updating your robot framework version

pip install -U robotframework