自动化Firefox和Chrome浏览器

编程入门 行业动态 更新时间:2024-10-24 22:24:09
本文介绍了自动化Firefox和Chrome浏览器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我要寻找一种方式来自动化夫妇浏览器......从外部应用程序/流程Firefox和Chrome(目前只在Windows中)。

I am looking for a way to automate couple of browsers... Firefox and Chrome (for now on just Windows) from an external application/process.

有没有办法做沿着这些线路的东西:

Is there a way to do things along these lines:

  • 用URL启动浏览器
  • 让浏览器加载网页,运行脚本等。
  • 检查DOM
  • 有关参考,IE可以使用它可以在一个shell脚本创建的InternetExplorer.Application对象使用下面的JavaScript自动化,然后我可以走了DOM API:

    For reference, IE can be automated using the InternetExplorer.Application object which can be created in a shell script using the following javascript, and then I can walk the DOM API:

    var ie = new ActiveXObject('InternetExplorer.Application');

    这里的激励场景自动测试。我想加载包含测试code中的页面,并收集结果在测试运行后。

    The motivating scenario here is automated testing. I'd like to load up the page containing the test code, and gather results after the test has run.

    推荐答案

    watin.sourceforge/

    华廷正是这么做的,我相信他们最近添加了镀铬的支持

    WatiN does exactly that, and I believe they recently added Chrome support

    更新2011/6/22:Currrently华廷仅适用于Firefox 2和3,不要在Firefiox 4(几乎肯定不会在Firefox 5,这是今天发布)。此外,这个答案的时候,据称是被添加铬的支持,但它看起来像从来没有完全成熟,现在没有列为其主页支载平台。

    Update 6/22/2011: Currrently WatiN only works on Firefox 2 and 3, not in Firefiox 4 (and almost certainly not in Firefox 5, which was released today). Also, the time of this answer, Chrome support was supposedly being added, but it looks like that never got fully baked and now is not listed as a suported platform on their home page.

    另外值得注意的,在我的经验,当我升级到IE9华廷有很多慢。我看到这两个不同的机器,并降级到IE8加速测试备份在两台机器上。

    Also worth noting, in my experience WatiN got a lot slower when I upgraded to IE9. I saw this on two different machines, and downgrading to IE8 sped the tests back up on both machines.

    我还在用大量华廷,但现在多为行为驱动的设计和功能的回归测试,这通常是不特定浏览器。然后,在FF和铬手动测试的所有测试进展

    I still use WatiN heavily, but now mostly for behavior driven design and functional regression testing, which generally are not browser-specific. Then, manually test in FF and Chrome for all progression testing.

    更新2015年9月22日:Elmue是正确的,它看起来像不再正在处理华廷。我们已经寻找到硒对我们的自动化验收测试今: www.seleniumhq

    Update 9/22/2015: Elmue is right, it looks like WatiN is no longer being worked on. We've looking into Selenium for our automated acceptance tests now: www.seleniumhq

    更多推荐

    自动化Firefox和Chrome浏览器

    本文发布于:2023-11-24 18:48:34,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1626404.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:浏览器   Firefox   Chrome

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!