For the second you have either to esape the '\' or put an '@' the start of the string. The problem is that C# interprets '\' as an escape sequence.

Does that help?

Cheers
Mark

On Thu, May 28, 2009 at 4:36 PM, Nancy Doherty <nancyd1111@hotmail.com> wrote:
Thanks for this and now that I am correctly using "Set", I'm not sure where this file should reside in order for the project to find it.  If I use a direct path, I also receive an error.
 
Thanks in advance!
 
ie.FileUpload(Find.ByName("ctl02$myfile")).Set("test.txt");
 
Error 2 TestCase 'Test.UI.Patient.Login' failed: System.IO.FileNotFoundException : File does not exist
   at WatiN.Core.FileUpload.Set(String fileName)
   at Test.UI.Patient.Login() in C:\TestDrivenNet\ui.Test.CashereNet\SmartEligibility.cs:line 48 C:\TestDrivenNet\ui.Test.CashereNet\SmartEligibility.cs 48 
 

ie.FileUpload(Find.ByName("ctl02$myfile")).Set("c:\temp\test.txt");
 
TestCase 'Test.UI.Patient.Login' failed: System.ArgumentException : Illegal characters in path.
at System.IO.Path.CheckInvalidPathChars(String path)
at System.IO.Path.NormalizePathFast(String path, Boolean fullCheck)
at System.IO.Path.GetFullPathInternal(String path)
at System.IO.FileInfo..ctor(String fileName)
at WatiN.Core.FileUpload.Set(String fileName)
C:\TestDrivenNet\ui.Test.CashereNet\SmartEligibility.cs(48,0): at Test.UI.Patient.Login()

 
 

Date: Wed, 27 May 2009 15:38:27 +0200
From: jeroen@vanmenen.nl
To: watin-users@lists.sourceforge.net
Subject: Re: [Watin-users] FileUploadClass


Hi,

You should use Set(fileName) instead of TypeText() (which isn't available on FileUpload element...)

HTH,
Jeroen

On Tue, May 26, 2009 at 7:01 PM, Nancy Doherty <nancyd1111@hotmail.com> wrote:
Can someone give me an example on how to use the FileUpload class?
 
This doesn't seem to work:
ie.FileUpload(Find.ByName("ctl02$myfile")).TypeText("test.txt");
 
Thanks!


Insert movie times and more without leaving HotmailŪ. See how.

------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, &
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com

_______________________________________________
Watin-users mailing list
Watin-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/watin-users




HotmailŪ goes with you. Get it on your BlackBerry or iPhone.

------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, &
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com
_______________________________________________
Watin-users mailing list
Watin-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/watin-users



Mark Levison - Agile/Lean Transition Coach || Agile Editor @ InfoQ ||
613-862-2538 (cell) || Twitter || Blog Recent Entries:
Acceptance Test Tools for Web Apps || Do You Suspect You Have a Less than Productive Person on Your Team?