0

I would like to implement this suggestion: How to test file download with Watin / IE9?

In the project, I added the references that poster referred to:

  • UIAutomationClient
  • UIAutomationTypes

However, Window wasn't resolved. So I added the following two references which resolved Window:

  • PresentationCore
  • PresentationFramework

However, the System.Windows.Window constructor doesn't support any arguments, yet the poster has an argument:

Window windowMain = new Window(WatiN.Core.Native.Windows.NativeMethods.GetWindow(browser.hWnd, 5));

The poster states that their solution works with .net 4 which is what my project is using, and it's full framework, not the client profile. Is the use of PresentationCore/Framework incorrect? I did try a reference to System.Windows.Forms, but Window isn't a class of it.

Let me be exceptionally clear as to what I'm trying achieve as I guess it wasn't obvious enough. I would like to implement the poster's solution as noted in the link in the first sentence of my question. Adding the references to UIAutomationClient/Types didn't resolve the Window object. So, I went looking for Window in the framework and found it in PresentationCore/Framework. By the response I got, I obviously shouldn't be using PresentationCore/Framework. So that's why I asked the question.

Community
  • 1
  • 1
voidmain
  • 1,521
  • 1
  • 12
  • 14
  • what??? PresentationCore.dll and PresentationFramework.dll are part of WPF. I have no idea what you're trying to achieve, but NO the `Window` class in WPF does not have any parameterized constructors. – Federico Berasategui Mar 06 '13 at 20:23
  • 1
    Although the type of windowMain is declared to be System.Window.Window, I believe it is actually an instance of a derived object. Note that the full name is given for the declarator, but not for the instantiator. – Pieter Geerkens Mar 06 '13 at 20:25
  • Makes sense. At first I thought Window was part of the IE object that Watin provides but I couldn't find it. Pieter Geerkens was correct. It's found in WatiN.Core.Native.Windows. – voidmain Mar 06 '13 at 20:29

1 Answers1

1

Pieter Geerkens answered the question. Window is found in WatiN.Core.Native.Windows.

voidmain
  • 1,521
  • 1
  • 12
  • 14