Robot Framework IMAPLibrary2

raw JSON →
0.4.11 verified Fri May 01 auth: no python

IMAPLibrary2 is a Robot Framework test library for testing IMAP email functionalities, such as fetching, deleting, and verifying emails. The current version is 0.4.11, with infrequent releases.

pip install robotframework-imaplibrary2
error ImportError: No module named IMAPLibrary2
cause Robot Framework cannot find the library because it's not installed or Robot Framework is not aware of the installed libraries.
fix
Run 'pip install robotframework-imaplibrary2' and ensure Robot Framework is installed (pip install robotframework).
error TypeError: 'int' object is not callable
cause Using a reserved keyword or variable name like 'id' or 'type' as argument values may cause collision with Python builtins.
fix
Avoid using 'id', 'type', 'list', etc. as variable names or quoted values.
error Connection to IMAP server failed: [SSL: CERTIFICATE_VERIFY_FAILED]
cause The library uses default SSL context which may reject self-signed certificates.
fix
Set environment variable 'IMAPLIB2_SSL_VERIFY' to '0' to disable verification, or use a trusted certificate.
gotcha The library keyword 'Open Mailbox' uses 'user' parameter, not 'username'. Many users mistakenly use 'username'.
fix Use 'user' in Open Mailbox call.
gotcha Timeouts in 'Wait For Email' are in seconds, not milliseconds. Common mistake is to pass a value that is too small.
fix Pass timeout as seconds, e.g., timeout=30 for 30 seconds.
deprecated The 'Open Mailbox' keyword's 'port' parameter is deprecated; use 'ssl' parameter instead if needed.
fix Use 'ssl=True' for default IMAPS port 993, or specify 'port=993'.

Basic Robot Framework test that opens an IMAP mailbox and waits for an email.

*** Settings ***
Library    IMAPLibrary2

*** Test Cases ***
Open Mailbox And Check Latest Email
    Open Mailbox    host=imap.example.com    user=${USER}    password=${PASSWORD}
    ${latest} =    Wait For Email    timeout=30
    Should Be Equal    ${latest.subject}    Hello World