Modal dialogs aren't part of a frame, they're generated and owned by ie, so this line: <br><br>
ie2.frame("ContentFrame").modal_dialog.text_field(:id,
'FileUploader').set('C:\Users\Public\Pictures\Sample Pictures\Dock.jpg')<br><br>should read: <br>
ie2.modal_dialog.text_field(:id,
'FileUploader').set('C:\Users\Public\Pictures\Sample Pictures\Dock.jpg')<br>
<br>-Charley<br><br><div><span class="gmail_quote">On 7/6/07, <b class="gmail_sendername">Michael Kernaghan</b> <<a href="mailto:MKernaghan@meridiansystems.com">MKernaghan@meridiansystems.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div link="blue" vlink="purple" lang="EN-US">
<div><pre>Bret Suggested: </pre><pre>>I think the error message may be misleading. I think the problem may </pre>
<p><span style="font-size: 10pt;">>actually
be caused by the use of frames. Can you show us the code that </span></p>
<p><span style="font-size: 10pt;">>is
failing?</span></p>
<p> </p>
<p>Certainly. Warts and all here it is:</p>
<p> </p>
<p>require 'watir'</p>
<p>require 'win32ole' </p>
<p>include Watir</p>
<p>require 'test/unit'</p>
<p> </p>
<p>$how_many = 3</p>
<p>$count = 0</p>
<p> </p>
<p>class TC_article_example < Test::Unit::TestCase</p>
<p> </p>
<p>def add_new</p>
<p> #Open, login and navigate </p>
<p> ie = IE.new</p>
<p> ie.goto("http:// corporate secrets
obscured ")</p>
<p> ie.text_field(:name,
"OrgNameTextbox").set("testing")</p>
<p> ie.text_field(:name,
"UserNameTextbox").set("testing")</p>
<p> ie.text_field(:name,
"PasswordTextbox").set("testing")</p>
<p> ie.button(:name, "LoginButton").click</p>
<p> assert(ie.contains_text("Please select a
workspace"))</p>
<p> </p>
<p> ie.link( :url, "http:// corporate secrets
obscured ").click</p>
<p> ie.link( :text, "Enter
Project").click</p>
<p> ie.link( :text, "APPLICATIONS").click</p>
<p> ie.link( :text, "Drawings").click</p>
<p> </p>
<p> #Launch and attach new document</p>
<p> ie.button(:value, "New").click</p>
<p> ie2 = Watir::IE.attach(:url, /Drawing/)</p>
<p> </p>
<p> #Populate
fields </p>
<p>
ie2.frame("ContentFrame").text_field(:name, /V:MainGeneral:SeriesIdentifier:SeriesIdentifierFieldRow:TheTextBox/).set(randomStr(10))</p>
<p>
ie2.frame("ContentFrame").text_field(:name,
/V:MainGeneral:DocTitle:DocTitleFieldRow:TheTextBox/).set(randomStr(10))</p>
<p> </p>
<p> ie2.frame("ContentFrame").button(:id,
"V_FileInformation_Attachments_SourceFileLink_MyUploadButton").click_no_wait</p>
<p> </p>
<p> #Error report cited line
follows </p>
<p>
ie2.frame("ContentFrame").modal_dialog.text_field(:id,
'FileUploader').set('C:\Users\Public\Pictures\Sample Pictures\Dock.jpg')</p>
<p> </p>
<p> #Save and Iterate</p>
<p> allFrames = ie2.getDocument().frames</p>
<p> count = allFrames.length</p>
<p> ie_docFrame = ie2.frame(:name,
allFrames.item(count-1).name)</p>
<p> </p>
<p> ie_docFrame.button(:id,
"V_DocTools_SaveButton_Button").focus</p>
<p> ie_docFrame.button(:id,
"V_DocTools_SaveButton_Button").click</p>
<p> </p>
<p> $count = $count+1</p>
<p> </p>
<p> ie.close</p>
<p> ie2.close</p>
<p>end</p>
<p> </p>
<p>def randomStr( len )</p>
<p> chars = ('a'..'z').to_a + ('A'..'Z').to_a
+ (0..9).to_a</p>
<p> len = rand(len) +1 </p>
<p> return (1..len).collect { |i|
chars[rand(chars.length),1] }.to_s</p>
<p>end</p>
<p> </p>
<p>def test_add_new</p>
<p> while $count <
$how_many #Error report cited line </p>
<p> add_new</p>
<p> puts $count </p>
<p> end</p>
<p>end </p>
<p> </p>
<p>end</p>
</div>
</div>
<br>_______________________________________________<br>Wtr-general mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:Wtr-general@rubyforge.org">Wtr-general@rubyforge.org</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://rubyforge.org/mailman/listinfo/wtr-general" target="_blank">
http://rubyforge.org/mailman/listinfo/wtr-general</a><br></blockquote></div><br>