控制 IE 的程序可以检测是否遇到 HTTP 30x 代码吗?

发布于 2024-08-30 11:43:48 字数 702 浏览 7 评论 0 原文

我正在尝试使用 Perl、Win32::OLE 以及来自 InternetExplorer.Application。 microsoft.com/en-us/library/aa752084%28VS.85%29.aspx" rel="nofollow noreferrer">MSDN。我的目标是尽可能全面地了解 IE 正在做什么。 (与这个问题相关。)

IE当程序完成处理某个 URL 的各个阶段(NavigateComplete2DownloadComplete DocumentComplete)时,使用事件来通知我的程序。它还可以告诉我的程序它遇到的各种错误(NavigateError2)。我认为我的问题的一部分已经得到很好的解决。

我还希望能够可靠地检测 IE 是否被服务器重定向。我主要担心 HTTP 30x 状态代码。有没有办法做到这一点,无论是通过 COM 自动化还是通过其他途径?

I am trying to control an InternetExplorer.Application via the COM interface, using Perl, Win32::OLE, and information from MSDN. My goal is to get as good an idea as possible about what IE is doing. (Related to this question.)

IE uses events to notify my program when it has finished various stages of processing a certain URL (NavigateComplete2, DownloadComplete DocumentComplete). It can also tell my program about various errors it encounters (NavigateError2). I consider that part of my problem solved well enough.

I would also like to be able to reliably detect if IE is redirected by the server. Primarily, I'm concerned about HTTP 30x status codes. Is there a way to do this, either with COM automation or via another route?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

谁把谁当真 2024-09-06 11:43:48

嗨 Hillu。

我使用 WatiN弯曲 Internet Explorer符合我申请的意愿。

我认为你不能将 Perl 与它一起使用。但无论如何它可能会有所帮助。

它是一个不错的 .NET 库,已有近 5 年的历史,致力于 Internet Explorer 的自动化,最初是为了加快 Web 应用程序的测试而开发的。

它的一些功能:

  • 自动化所有主要 HTML 元素
  • 通过多个属性查找元素
  • 支持 AJAX 网站测试
  • 支持框架(跨域)和 iframe
  • 支持弹出对话框,如警报、确认、登录等。
  • 支持 HTML 对话框(模式和非模式)
  • 提供页面和控制模型。
  • 支持创建网页屏幕截图
  • 具有基本(可扩展)日志记录机制
  • 易于与您最喜欢的(单元)测试工具集成
  • 适用于 Internet Explorer 6、7、8 以及 FireFox 2 和 3

我确信您是否查看过它的< a href="http:///watin.sourceforge.net/doc" rel="nofollow noreferrer">文档 你会发现一些有用的东西来帮助你解决你的问题,如果没有,我认为这个博客< href="http://watinandmore.blogspot.com/2008/04/捕捉-server-errors-with-watin.html" rel="nofollow noreferrer">帖子将为您提供一种简单的检查方法如果 IE 打开服务器错误页面。

希望有帮助。法比奥

Hi Hillu.

I use WatiN to bend Internet Explorer to the will of my applications.

I don't think you can use Perl with it. But any way it might help.

Its a nice .NET library with almost 5 years, its devoted to the automation of Internet Explorer, first developed to speed up testing of Web Applications.

Some of its features:

  • Automates all major HTML elements
  • Find elements by multiple attributes
  • Supports AJAX website testing
  • Supports frames (cross domain) and iframes
  • Supports popup dialogs like alert, confirm, login etc..
  • Supports HTML dialogs (modal and modeless)
  • Provides a Page and Control model.
  • Supports creating screenshots of webpages
  • Has a basic (extensible) logging mechanism
  • Easy to integrate with your favorit (unit) test tool
  • Works with Internet Explorer 6, 7, 8 and FireFox 2 and 3

I'm sure if you have a look around its documentation you will find something of use in helping you with your problem, and if not i think this blog post will give you a simple way of checking if IE as turned a server error page.

Hope it helps. Fábio

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文