开发者

is it possible to close MS Windows print pop up window using selenium

is it possible to close print pop up window using selenium..

Scenario is, on clicking print icon a pop up opens with preview and on top of it MS Windows Print pop up comes.

I could able to do validation in the preview window but unable to close the window because the presence of MS Windows print. SO this window always present in open state while executing other cases, i mean my cases are running but it开发者_StackOverflow中文版s blocking the view, almost half screen.

So i want to close the MS Windows Print pop-up and the i can close the preview window by selenium because it has 'Close' link


Computer Says No.

from the selenium cor faq :

...Currently there is not much that can be done about IE modal dialogs.


I have a messy workaround right now that involves using AutoIT (http://www.autoitscript.com/site/autoit/) to just press alt + f4, I wrote a simple script, compiled it, and called it from my C# code, that I'm running on Selenium RC. I'm looking for a better way now since this is only a workaround, a quick fix allowing me to run it until I can write it in a cleaner way.

Code for AutoIT:

; Script Start
WinClose("Window Name")

C# Code

Process.Start("WindowClose.exe");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜