【问题标题】:How to test downloading files with Vividus tool如何使用 Vividus 工具测试下载文件
【发布时间】:2020-09-14 13:32:38
【问题描述】:

我正在使用Vividus 来测试我的应用程序。

单击下载按钮后如何测试文件是否已下载?

【问题讨论】:

    标签: automation ui-automation vividus


    【解决方案1】:

    推荐的方法:

    • 在 Web UI 上找到链接
    • 提取链接网址
    • 使用vividus-plugin-rest-api 步骤下载文件(您可能还需要使用vividus-plugin-web-app-to-rest-api 步骤将cookie 从浏览器注入到Web UI)
    • 验证 HTTP 响应代码和内容

    实现示例:

    When I set 'href' attribute value of the context element to the 'scenario' variable 'file-to-download'
    When I set browser cookies to the API context
    When I issue a HTTP GET request for a resource with the URL '${file-to-download}'
    Then `${responseCode}` is equal to `200`
    

    【讨论】:

      猜你喜欢
      • 2020-09-23
      • 1970-01-01
      • 2017-11-24
      • 1970-01-01
      • 2011-11-21
      • 2020-10-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多