gpt4 book ai didi

selenium-ide - 我如何要求 Selenium IDE 检查 HTTP 状态代码(例如 2XX、404、500)

转载 作者:行者123 更新时间:2023-12-04 18:43:52 24 4
gpt4 key购买 nike

如何在加载页面后让 Selenium IDE 测试 HTTP 状态代码?我知道这在常规 Selenium 中是可能的(但很尴尬),在 Selenium-IDE 中怎么样?是否有插件或其他方式来获得类似的东西:

open http://www.example.com/changepassword/obama
assertHTTPStatus 5XX

因此断言成功(或这种情况下失败)或特定的开放?在不检查状态代码的情况下,我必须检查页面文本,这很脆弱,因为有人可能会重新设计错误页面的外观或感觉。

有许多现有的 Stack 问题涉及这个主题,但没有直接解决它:
  • Selenium IDE - always fail on any 500 error
  • Checking HTTP Status Code in Selenium
  • 最佳答案

    你不能。 Selenium 开发人员有意识地决定不在 Webdriver 级别包含此数据。见 webdriver Bug #141和博文 Rantings of a Selenium Contributor清楚地列出了它:

    Just as proponents of wanting to see HTTP status codes in the WebDriver API are convinced that the arguments against including it don't hold water, the members of the project team are equally convinced that adding it is a bad idea.



    如果你真的想这样做,你必须使用诸如 in this answer之类的技巧。 ,或选择其他工具。

    关于selenium-ide - 我如何要求 Selenium IDE 检查 HTTP 状态代码(例如 2XX、404、500),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18391511/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com