【问题标题】:Have a wait / timeout when running selenium test suite in command prompt在命令提示符下运行 selenium 测试套件时有等待/超时
【发布时间】:2019-10-23 11:48:43
【问题描述】:

在 Selenium IDE 中运行我的测试套件时,测试通过,因为 IDE 允许有足够的时间 (30000) 来查找元素。

使用命令行运行我的测试套件时,测试失败并出现下面的超时错误。

我尝试通过在命令行中添加单词“--timeout [60000]”来为命令添加超时, 示例:

selenium-side-runner --timeout [60000] -c "browserName=chrome" "Desktop/SIDE with CMD/CmdWithoutInit2.side"

我还在 Selenium IDE 中的实际测试中添加了“暂停”和各种“等待”,所有这些都在 IDE 中工作,但在 Command 中运行时为空。

TimeoutError: Waiting for element to be located By(css selector, #select2-ProjectID-v1-container > .select2-selection__placeholder) 15051ms后等待超时

我需要一种方法来使用命令行运行 Selenium IDE (.side) 测试套件。为此,我需要 CMD 为测试提供足够的时间来找到每个元素,就像 IDE 一样。我希望有几句话可以添加到命令本身。

【问题讨论】:

  • 嗨!您能否添加测试失败的代码部分?

标签: selenium command-line command-prompt selenium-ide


【解决方案1】:

答案是将 --timeout 6000 添加到命令行。 例如,在命令提示符下,输入

运行测试

selenium-side-runner --timeout 60000 -c "browserName=chrome" "Desktop/Name.side"

超时语法不包括方括号,如果需要可以删除 --debug,不提供有关实际运行测试的有用信息,仅在运行侧运行器本身上。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-06-27
    • 2012-10-27
    • 2014-12-26
    • 1970-01-01
    • 1970-01-01
    • 2019-12-28
    相关资源
    最近更新 更多