Watin:验证子浏览器的链接并关闭它
我正在尝试找到一种关闭子浏览器的方法,其想法是当浏览器弹出时(当前使用 IE 和 mozilla 的选项卡)它将加载然后关闭。
我唯一能想到的是在浏览器打开后插入这个
IE newIE = new IE();
newIE.Close();
可悲的是它不起作用。我知道 watin 可以打开两个或三个浏览器,但它可以打开并切换到另一个浏览器,然后返回主浏览器
主浏览器= >子浏览器(关闭此)==>主浏览器
我在这里缺少什么?
我尝试过类似的方法,但它不起作用
IE ie = IE.AttachToIE(Find.ByUrl("google.com"));
ie.Close();
I'm trying to find a way to close a child browser, the idea is when the browser pops up(currently using IE & tab for mozilla)it will load and then closes.
The only thing i can think of is inserting this after the browser opened
IE newIE = new IE();
newIE.Close();
Sadly it doesn't worked.I know watin can open two or three browsers but can it open and shift to another browser and then go back to the main browser
Main browser => child browser(close this) => Main browser
What am i missing here?
I tried something like this but it doesn't work
IE ie = IE.AttachToIE(Find.ByUrl("google.com"));
ie.Close();
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我试图在一些测试中做类似的事情,但我也遇到了一些问题。您可能会发现添加线程睡眠会有所帮助。这就是我所拥有的:
I was trying to do something similar in some of my tests and I was having some problems too. You may find that adding a thread sleep will help. This is what I had: