Selenium ImeActivationFailedException 和 ImeNotAvailableException

Selenium ImeActivationFailedException and ImeNotAvailableException

在阅读 selenium common exceptions 时,我遇到了以下两个例外情况。

exception selenium.common.exceptions.ImeActivationFailedException
(msg=None, screen=None, stacktrace=None)
Thrown when activating an IME engine has failed.

exception selenium.common.exceptions.ImeNotAvailableException
(msg=None, screen=None, stacktrace=None)
Thrown when IME support is not available. This exception is thrown for every IME-related method call if IME support is not available on the machine.

一个。 IME引擎是什么意思?

b。什么时候会出现以下异常?我们需要在 Finally 块中编写什么样的清理代码?

你可以参考我下面关于输入法的回答link:

What exactly does ime() in selenium do?

当您 ImeActivationFailedExceptionImeNotAvailableException 这些异常时,您无法在测试网页中输入所需的 (Chinese/Japanese/etc) 个字符 , 因此建议通过适当的消息使测试失败。