2012-01-18 89 views
0

我使用硒IDE,我必须生成一个脚本,如果发生超时错误,它会将我重定向到gmail,并且我将发送电子邮件给客户支持。如果时间错误没有出现,那么下一步将执行。在IDE中避免超时错误

是否可以生成这样的脚本? 我们可以在硒IDE中设置计时器吗?

或者是否有解决方案来避免超时错误?

回答

0

我不知道硒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 
+0

是的,你right..but我找的硒IDE做的一样。 – 2012-01-21 08:52:06