smokeid means nothing in standard dom. You can use :text to identify the control. Watir works off of standard html attributes and the DOM, this is some sort of custom attribute. This should work.
ie.button(:text, 'Login').click -Charley On 4/30/07, Kui Zhang <[EMAIL PROTECTED]> wrote:
Hello, I just started to write a test script below. When run the script, I always received error message: C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1928:in `assert_exists': Unable to locate object. HTML source is attached. What did I missing here? Should I be able to use smokeId to identify the elements? Please help. Thanks! Kui require 'watir' test_site = 'http://xxxxx' ie = Watir::IE.new ie.goto(test_site) sleep(5) ie.text_field(:label, "Username").set("aa") ie.text_field(:text, "Password").set("bb") ie.button(:smokeId, "submit").click Source: <input type="hidden" name="1_1" id="1_1" smokeId="__msgs__"><tr><td> </td><td align="right"><span class="login-input-label">Username</span></td><td align="left"><input type="text" name="1_2" id="1_2" smokeId="username" label="Username" value="" onChange="if (EventHandlers.valueChanged(this)==false) return false;" onKeyDown="DHTML.cancelBubbleIfNoAltKeyOrEnter();" contenteditable="true" delayOnChange="false" class="txt" style="text-align: left" size="20" helpText="__UseTitle__" onfocus="EventHandlers.onFocus()" onblur=" EventHandlers.onBlur()"></td></tr> <tr><td> </td><td align="right"><span class="login-input-label">Password</span></td><td align="left"><input value="" type="password" class="txt" smokeId="password" id="1_3" helpText="__UseTitle__" delayOnChange="false" label="Password" onfocus=" EventHandlers.onFocus()" onChange="if (EventHandlers.valueChanged(this)==false) return false;" size="20" name="1_3" onblur="EventHandlers.onBlur ()"></td></tr> <tr><td colspan="2"> </td><td><button smokeId="submit" onclick=" Events.invokeEvent('1_4_act', true)" class="login-button" onrecordclick=" Recorder.recordLogin()" isDefault="true">Login</button></td></tr> _______________________________________________ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
_______________________________________________ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general