History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: WTR-188
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Jeff Fry
Votes: 1
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Watir

file_field set method fails on folders containings many files (>1000)

Created: 11/Dec/07 07:43 PM   Updated: 06/Jan/08 01:27 PM
Component/s: None
Affects Version/s: 1.5.2
Fix Version/s: Future

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
Environment: Windows XP, Internet Explorer 6 SP2


 Description  « Hide
Reported by: Lauro Canonica

The FileField.set method fails if there are more than 1000 files in the folder containing the file:

This code fails:
$ie.file_field(:id, file).setPatched(fileName);

Watir sets the name in the filename field before the "Choose window" is ready.
The "Choose Window" will then wait forever.

Suggested quick fix:
Add a @autoit.Sleep(1000) before setting the file name field

Watir.rb line 4069:
system("rubyw -e \"require 'win32ole'; @autoit=WIN32OLE.new('AutoItX3.Control'); waitresult=@autoit.WinWait 'Choose file', '', 15; if waitresult == 1\" -e \"@autoit.Sleep(1000); @autoit.ControlSetText 'Choose file', '', 'Edit1', '#{setPath}'; @autoit.ControlSend 'Choose file', '', 'Button2', '{ENTER}';\" -e \"end\"")

 All   Comments   Work Log   Change History      Sort Order:
Bret Pettichord - 06/Jan/08 01:26 PM
Thanks for reporting the problem and the workaround.

I'm reluctant to commit the suggestion to trunk, since it only masks, rather than cures the problem. What we need is to find a way to sleep until we KNOW that the window is ready.