我尝试使用robotframework-imaplibrary中的示例:
Open Mailbox host=imap.domain.com user=${mail} password=${PW}
${LATEST} = Wait For Email sender=${sender} timeout=300
${parts} = Walk Multipart Email ${LATEST}
:FOR ${i} IN RANGE ${parts}
\\ Walk Multipart Email ${LATEST}
\\ ${content-type} = Get Multipart Content Type
\\ Continue For Loop If '${content-type}' != 'text/html'
\\ ${payload} = Get Multipart Payload decode=True
\\ Should Contain ${payload} your email
\\ ${HTML} = Open Link From Email ${LATEST}
\\ Should Contain ${HTML} Your email
Close Mailbox
在测试运行后,我收到第三行的错误($ {parts} =遍历多部电子邮件$ {LATEST}):
TypeError:initial_value必须为str或None,而不是字节
有人知道电子邮件检查的有效示例吗?