tags:

views:

151

answers:

1

Hi

I'm using WatiN automation tool. I've a scenario where i need to click on a button when i do so a popup appears now i've to upload a file in the popup. I used Fileupload method but it is not working the window where the file is present appears and closes immediately without uploading the file. please suggest some solution. below is the code i'm using...

ie.Button(Find.ByText("Upload_File")).ClickNoWait(); now popup appears

IE popup = IE.AttachToIE(Find.ByUrl("http://localhost/admin/Uploadfile.aspx")); popup.Fileupload(Find.ById("upload1_File")).set("D:\vinay\watin.zip");

A: 

Why don't you just set the field (that hold the path) without showing the pop-up, or clicking any buttons? All you need is get the text field Id & do something like:

ie.TextField("Upload_File_Path_Field_ID")).Text = "D:\vinay\watin.zip";
Shady M. Najib