【发布时间】:2012-01-18 11:59:09
【问题描述】:
我正在使用 selenium IDE,我必须生成一个脚本,如果发生超时错误,它会将我重定向到 gmail,并且我将向客户支持发送电子邮件。如果没有出现时间错误,则将执行下一步。
是否可以生成这样的脚本? 我们可以在 selenium IDE 中设置计时器吗?
或者有什么办法可以避免超时错误?
【问题讨论】:
标签: testing selenium automation timeout selenium-ide
我正在使用 selenium IDE,我必须生成一个脚本,如果发生超时错误,它会将我重定向到 gmail,并且我将向客户支持发送电子邮件。如果没有出现时间错误,则将执行下一步。
是否可以生成这样的脚本? 我们可以在 selenium IDE 中设置计时器吗?
或者有什么办法可以避免超时错误?
【问题讨论】:
标签: testing selenium automation timeout selenium-ide
我不了解 selenium IDE,但在这种情况下的一般解决方案是(使用 Python 语法):
try:
# code that may generate timeout error
except TimeoutError:
# redirect to gmail
else:
# code that should be executed if there is no timeout error
【讨论】: