硒IDE会等待超时还是在1000毫秒(设置速度)后执行下一个命令



如果设置速度为1000毫秒,默认超时为30000毫秒。硒IDE会等待超时还是在1000毫秒后执行下一个命令?

http://software-testing-tutorials-automation.blogspot.com/2013/03/use-of-setspeed-and-settimeout-commands.html

"setSpeed"命令设置两个命令执行之间的延迟,或者我们可以说它对管理selenium的执行速度很有用。默认情况下没有任何这样的延迟,但如果你的应用程序很慢,那么你必须在你的srpt中使用"setSpeed"命令。-更多信息,请访问:http://software-testing-tutorials-automation.blogspot.com/2013/03/use-of-setspeed-and-settimeout-commands.html#sthash.frfeBCFD.dpuf

"setTimeout"命令控制操作完成的超时时间。-更多信息,请访问:http://software-testing-tutorials-automation.blogspot.com/2013/03/use-of-setspeed-and-settimeout-commands.html#sthash.frfeBCFD.dpuf

所以,如果我理解你的要求:每个命令至少间隔3000毫秒。因此,如果你做两个echo语句,你会看到第一个在0s,然后在3s后,第二个命令:

<tr>
    <td>setSpeed</td>
    <td>3000</td>
    <td></td>
</tr>
<tr>
    <td>echo</td>
    <td>a</td>
    <td></td>
</tr>
<tr>
    <td>echo</td>
    <td>b</td>
    <td></td>
</tr>

有了超时,如果执行AndWait命令,它将等待,直到命令为true或超时时间过去。这可以在页面加载(有一个隐含的等待)上得到最好的体现:

<tr>
    <td>setTimeout</td>
    <td>5000</td>
    <td></td>
</tr>
<tr>
    <td>open</td>
    <td>https://httpbin.org/delay/6</td>
    <td></td>
</tr>

[info]正在执行:|setTimeout|5000||

[info]正在执行:|open|https://httpbin.org/delay/6| |

[error] 5000ms后超时

因此,是的,在它尝试加载下一个命令之前,将遵守超时。

最新更新