使用网络浏览器 WatiN
我使用以下代码将 watin 绑定到 winform 上的网络浏览器。
Dim w As IE = New IE(WebBrowser1.ActiveXInstance)
Settings.AutoStartDialogWatcher = False
w.GoTo("http://google.com")
我可以从wireshark 中看到页面已加载,但表单被冻结,直到抛出异常“Internet Explorer 忙时超时”。
有没有办法将 watin 绑定到 webbrowser 控件?
I'm using the following code to bind watin to a webbrowser on the winform.
Dim w As IE = New IE(WebBrowser1.ActiveXInstance)
Settings.AutoStartDialogWatcher = False
w.GoTo("http://google.com")
I can see from wireshark that the page get's loaded, but the form is frozen until a exception gets thrown "Timeout while Internet Explorer busy".
Is there a way to bind watin to the webbrowser control ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
首先,我认为这一行:
应该位于开头,在创建 IE 实例之前。
如果您在单独的线程中运行您的代码,它将会工作。
C# 代码(抱歉):
First of all, I think that this line:
should be at the beginning, before
IE
instance is created.Your code will work if you run it in separate thread.
Code in C# (sorry):
如果我使用此代码,它会起作用
如果它不是最好的解决方案,但它对我有用
If I use this code it works
If it is not the best solution, but it works for me