Is there any support for working with popup dialogs (specifically file downloads) in c#?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
From the WebDriver FAQ: WebDriver offers the ability to cope with multiple windows. This is done by using the "WebDriver.switchTo().window()" method to switch to a window with a known name. If the name is not known, you can use "WebDriver.getWindowHandles()" to obtain a list of known windows. You may pass the handle to "switchTo().window()".
Full FAQ here.
Example from Thoughtworks
Below is the example converted from Java into C# (with deprecated methods replaced)
No, there isn't - at least not natively.
WebDriver only interacts with the webpage. A popup dialog, once instantiated, becomes the domain of the operating system instead of the webpage.
You can circumvent the file download/upload dialog by issuing a POST or a GET with the content you are retrieving or sending to the server.
You can use tools such as AutoIt, or the Windows Automation API, to interact with other dialog windows.
For a popup windows dialog, you can use the alert to catch: