拼命尝试让 Watin 与 IE 一起工作
我和 Watin 一起工作了大约 1 周。我真的很想让 Firefox 工作,但大约一天后我不得不放弃,因为我发现我无法让 jSSH 与 Firefox 8 等一起工作。我真的希望有一种使用 Chrome 或 Firefox 的方法,我不得不说
所以返回我不情愿地使用 Watin 开发了一些自动化软件,但是 Goto(href) 一直存在问题,页面似乎从未真正被标记为完成。尽管浏览器导航到该页面并且我可以很好地看到该页面,但对 Goto() 的调用只是超时。在那之后,我尝试的任何操作都会失败,并且无法在 dom 中找到元素,并且我无法以编程方式单击任何内容。所以我必须解决这个超时问题,
我已经阅读了各种建议修复的文章,并据我所知尝试了所有这些,即确保我以管理员身份运行,确保关闭 Internet Explorer 增强的安全性等。我会真的,真的很想让 Watin 工作 - 但现在我准备放弃并在我的应用程序中使用嵌入式浏览器创建一个非常非常简单的类。所以 stackoverflow 是我的最后一个停靠点。我怎样才能阻止 Watin 超时。
我使用的是 Windows 7 Ultimate 版本 6.1.7601 Service pack 1 build 7601 视觉工作室2010 编译为 .net 4.0 应用程序 IE 9.0.8112.16421 更新 KB2586448 我的主入口点上有一个控制台应用程序,没有线程,[STAThread]
这是我的 Visual Studio 信息:-
Microsoft Visual Studio 2010 版本 10.0.40219.1 SP1Rel Microsoft .NET Framework 版本 4.0.30319 SP1Rel Microsoft Visual C# 2010 01021-532-2002102-70185
我们将非常感激您的任何帮助。
问候朱利安
I have been working with Watin for about 1 week. I really wanted to make firefox work but had to give up after a day or so when seeing there was no way i could get jSSH working with Firefox 8 etc. Really wish there was a way of using Chrome or firefox i have to say
So returning reluctantly to IE I developed some automation software using Watin, however I have a persistent problem with Goto(href) where it seems as though the page never actually gets marked as complete. And although the browser navigates to the page and I can see the page fine, the call to Goto() just times out. After that point anything I try fails and it cant find the elements in the dom and I cant click anything programmatically. So I have to solve this timeout issue
I have read various articles suggesting fixes and have tried them all as far as I can see i.e. making sure I run as administrator, making sure that internet explorer enhanced security is switched off, etc.. I would really, really like to make Watin work - but right now I am about ready to give up and create a much, much simpler class with an embedded browser in my app. So stackoverflow is my last port of call. How can I stop Watin from timing out.
I am on Windows 7 Ultimate Version 6.1.7601 Service pack 1 build 7601
Visual Studio 2010
compiling as a .net 4.0 app
IE 9.0.8112.16421 with update KB2586448
I have a console app, no threads, [STAThread] on my Main entry point
This is my Visual Studio info:-
Microsoft Visual Studio 2010 Version 10.0.40219.1 SP1Rel
Microsoft .NET Framework Version 4.0.30319 SP1Rel
Microsoft Visual C# 2010 01021-532-2002102-70185
Any help will be very greatfully received.
Regards Julian
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好吧,经过几个月的玩耍和摆弄,我的问题的答案有几个部分。
首先。我需要让 Watin 作为 win32 应用程序中的嵌入式浏览器正常工作,而不是作为控制台应用程序。这需要我花费大量的精力让 Watin 按照我想要的方式嵌入,我在 STATHREAD(当然)和弹出对话框观察器方面遇到了问题,并将浏览器的 HWND 放入 Watin 中以创建其浏览器对象(我在堆栈溢出上使用了另一个示例来执行此操作),然后我必须确保 ScriptErrorsSuppressed=true 并且我终于让它工作了。然而
,我最初遇到的问题似乎仍然存在于 Watin.2.1.0.1196 处理 asda.com 上的帧集时。
所以我刚刚完成了 watin 项目的 svn 检查,我终于希望我看到的最新更新能够一劳永逸地解决这个问题......是的,我仍然非常期待 Jeroen 获得 IE9 或者确实与 Watin 配合使用的任何其他浏览器。使用 IE(任何风格)都很糟糕
ok, so after many months of playing and fiddling the answer to my question has several parts.
Firstly. I needed to get Watin working properly as an embedded browser in a win32 application rather than as a console app. This required me to spend a huge amount of effort getting Watin embedded the way I wanted, I had problems with STATHREAD (of course), and the pop up dialog watcher, and getting the HWND of my browser into Watin to create its browser object (I used another sample on stack overflow to do this) and then I had to ensure ScriptErrorsSuppressed=true and I finally got it working. Hoorah
However, the problem I originally had all that time ago still seems to remain with Watin.2.1.0.1196 in dealing with frame sets on asda.com.
So I have just now done a svn checkout of the watin project and I am finally hoping that the latest updates I have seen will fix this problem once and for all... and Yes I am still really looking forward to Jeroen getting IE9 or indeed any other browser working with Watin. Working with IE (any flavour) sucks
据我所知,WaTiN 还不完全支持 IE9。 Jeroen(创建者)正在努力使其与 IE9 完全兼容,但 IE9 依赖于以前版本的 IE 的新 WPF 组件,因此我猜测这需要一些工作。
当我们将 WatiN 测试升级到 IE9 时,我们也遇到了一些问题。最后,我们强制我们的网站将所有内容渲染为 IE8 标准,并将 IE9 设置为 IE8 渲染模式,直到 watin 进行更新以完全支持 IE9 及其所有怪癖和功能。
WaTiN does not support IE9 fully yet as far as I know. Jeroen (the creator) is working on getting it fully compatible with IE9, but IE9 relies on new WPF components in regards to previous versions of IE, so i'm guessing this will take some work.
We suffered from several problems as well when we upgraded our WatiN tests to IE9. In the end we force our website to render everything to IE8 standards and set IE9 to IE8 rendering mode untill there is an update from watin to fully support IE9 with all its quirkcs and features.