dl.dropb..." />

Watir-Webdriver: Uploading files isn't working correctly on firefox?

Your local file you are uploading mustn't exist locally I have uploaded your HTML to: dl.dropbox.com/u/18859962/uploader.html" rel="nofollow">dl.dropbox.com/u/18859962/uploader.html I tried this: ruby-1.9.2-p290 :001 > require "watir-webdriver" => true ruby-1.9.2-p290 :002 > be = Watir::Browser. Start "dl.dropbox.com/u/18859962/uploader.html" rel="nofollow">dl.dropbox.com/u/18859962/uploader.html" => # ruby-1.9.2-p290 :003 > b. File_field.

Exists? => true ruby-1.9.2-p290 :004 > local_file = "/users/me/ie. Html" => "/users/me/ie.

Html" ruby-1.9.2-p290 :005 > File. Exists? Local_file => true ruby-1.9.2-p290 :006 > raise "error" unless File.

Exists? Local_file => nil ruby-1.9.2-p290 :007 > b. File_field.

Set local_file => "/users/me/ie. Html Please run your script against this hosted html file and report back Also, you should raise an exception if the local file doesn't exist, so that eliminates that error.

Your local file you are uploading mustn't exist locally. I have uploaded your HTML to: dl.dropbox.com/u/18859962/uploader.html" rel="nofollow">dl.dropbox.com/u/18859962/uploader.html I tried this: ruby-1.9.2-p290 :001 > require "watir-webdriver" => true ruby-1.9.2-p290 :002 > be = Watir::Browser. Start "dl.dropbox.com/u/18859962/uploader.html" rel="nofollow">dl.dropbox.com/u/18859962/uploader.html" => # ruby-1.9.2-p290 :003 > b.

File_field. Exists? => true ruby-1.9.2-p290 :004 > local_file = "/users/me/ie.

Html" => "/users/me/ie. Html" ruby-1.9.2-p290 :005 > File. Exists?

Local_file => true ruby-1.9.2-p290 :006 > raise "error" unless File. Exists? Local_file => nil ruby-1.9.2-p290 :007 > b.

File_field. Set local_file => "/users/me/ie. Html Please run your script against this hosted html file and report back.

Also, you should raise an exception if the local file doesn't exist, so that eliminates that error.

Click the link I just added to my post and you'll see more html. I'm using firefox v. 5.0.1 on mac os 10.7.1.

Also folderName is a variable for the folder that would contain the needed files. – thisiscrazy4 Sep 4 at 3:45 Still can't reproduce your problem - see edited answer above. Are you really, really sure the local file exists?

– Alister Scott Sep 4 at 10:24 100% sure it exists. >> File. Exists?""+folderName+"/iTunesArtwork" => true – thisiscrazy4 Sep 4 at 15:21 also the choose file button is a bit different on the actual site.

Not sure if this would make a difference? Cl.Ly/1i421Z1D3d0j2R3a3t3f – thisiscrazy4 Sep 4 at 15:30 Are you trying to upload a single file or a whole directory? Isn't 'iTunesArtWork' a directory?

– Alister Scott Sep 4 at 20:33.

In terms of this part of your question: As you can see the html is in a form tag. If I try to access the file_field without going through the form first it will give me an error saying element can't be interacted with because it's not visible. Anyone have a clue what's going on?

The most likely answer is that there may be another input field in the DOM that has the same name and is not currently visible to the user. Without being able to look at the entire page and see all the HTML, I can't say for sure, but that error is typical of when I've tried to interact with controls that had the same name or text as others, but were currently hidden from view. Searching the page code for the name or text I was using would usually discover the other element.

Changing how I was addressing things (either by specifying a unique container as you are doing, or adding an :index value along with the existing identifier will then allow you to get the 'right' instance of the element. You could switch to using :id to identify the field (it has one), and see if that works without having to specify the outer (form) container element first. Selecting by ID is generally preferred anyway as the value should be unique on the page if it's valid HTML.

That doesn't address the 'why doesn't it upload' aspect of your question however, which I suspect is the real problem you need help with. But it does address that aspect of your question. As to the rest, without being able to interact with the site myself, it's difficult to say why it is behaving the way it is.(and if the site is itunes, you should check what their terms of service has to say about using automation to access the site).

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions