I’m using WatiN 2.1.0 (C#) with IE 9 on Windows 7 64 bit.
My problem is that calling this function
ie.FileUpload(Find.ByName(someRegExp)).Set(fileName);
is extremely slow.
I mean object is nicely found. This code opens file dialog, but it starts to type file name after really long time, about 3 to 5 minutes, much longer then WatiNs timeouts. After this rest of the test is working as it should.
Is there some cure for this? This big delay is very annoying and when there is more test cases with file uploads it significantly extends test duration.
Ok, this is not a Watin solution per say, but we had the exact same problem; our file browser tests took up a lot of the total test time, and I solved it by kicking out Watin for fileuploads and instead use the (horrific) UIAutomation framework.
Example usage:
You have to add referefences to “UIAutomationClient” and “UIAutomationTypes” in your test project. And the solution below is not generic so you might have to tweak it to fit your needs.