Kingson, I hate saying this, but it worked on my computer. What was line 4, setting the text for the user's email address?
Anyway, I have ruby 1.8.6 and watir 1.6.6 - I tried it with watir 1.6.7 too, also worked. Good luck, Dave On Nov 25, 10:06 pm, Kingson Zhou <xiaomayi0...@gmail.com> wrote: > Hi all, > There are a login module, i want use watir realize auto login, but it always > failed. > I need help for error as below, thanks. > * > * > 1.HTML code: > > <div id="member"> > <form action="/j_spring_security_check" method="post" > id="form_header"> > <input type="hidden" id="redirectURL" > name="redirectURL"/> > <div class="login_bar"><input type="text" class="txt > lfloat" > name="j_username" value="email:" onFocus="focusUsername(this);" > onBlur="blurUsername(this);" maxlength="100"/></div> > <div class="login_bar"><input type="text" > class="pword lfloat" > name="j_password" value="password:" onFocus="focusPwd(this);" > onBlur="blurPwd(this);" maxlength="30"/></div> > <input name="_spring_security_remember_me" id="ckb" > class="lfloat > cb" type="checkbox" /> > <label class="lfloat" for="ckb">remeber me</label> > > <input type="submit" class="login lfloat png" > value="click"> > <div><a href="/account/register > <view-source:http://172.16.214.23/account/register>" class="reg lfloat > png">sing up</a></div> > </form> > </div> > > 2.watir code: > > require 'watir' # the watir controller > > ie = Watir::IE.start("http://172.16.214.23") > ie.text_field(:name, "j_username").set("xiaomayi0...@gmail.com") > ie.text_field(:name, "j_password").set("123456") > ie.button(:value, "click").click > if ie.contains_text("Programming Ruby") > puts "Test Passed. Found the test string: 'Programming Ruby'. > Actual Results match Expected Results." > else > puts "Test Failed! Could not find: 'Programming Ruby'" > end > > 3.After executed, output results: > C:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/input_elements.rb:375: in > `method_missing': fireEvent (WIN32OLERuntimeError) > > OLE error code:80004005 in htmlfile > > Unspecified error。 > > HRESULT error code:0x80020009 > > accidents。 from > C:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/input_elements.rb:375: in > `set' > > from E:/ruby/RubyApplication1/lib/main.rb:4 > > -- > ------------------------------------------------------------- > 工作的层次(依靠谱程度从低到高)=有做->做完->做对->做好->帮助他人做好 > My Blog:http://xiaomayi0323.byethost7.com/ -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com