Hi
I'm trying to write automation that will test a web-page with C#.
I'm using selenium web driver but it cannot interact with native windows.
The code need to automatically upload a file by interacting with a Dialog window,
so I'm trying to use C# code to control a dialog window.
I have managed to get a handle on the window using the following code:
public const int WM_SYSCOMMAND = 0x0112;
public const int SC_CLOSE = 0xF060;
public const int WM_SETTEXT = 0x000C;
private void ChooseFile()
{
int iHandle = FindWindow("#32770", "File Upload");
if (iHandle > 0)
{
}
}
What I need to do next is to choose the file to upload and then press OK to approve.
Help will be much appreciated!