Hi Natasha! I've run into the same problem with password confirmation fields when adding a user in an application. If the field will not accept focus from Watir, you may need to see if you can get your developer to change the properties on it. I tried everything I could think of and even solicited help from several experts on the list with whom I could share my private URL. In my case, there was no way around the protection on the field.
Off the top of my head, the things I tried were: - using each property available to identify the field - using the field index to identify it - using send keys to tab to the field from a known location and type in it If none of these work for you, I suggest you work with your developer to get it changed. Sorry I couldn't be more help..... -Tiffany On Oct 7, 10:27 am, Natasha <[EMAIL PROTECTED]> wrote: > Hello All, > > I am trying to automate Fotolog's login page. Please could you help > me. > > Following is the snippet of HTML code: > ------------------------------------------------------------------------------- > > <table> > <tr> > <td class="label">Username:</td> > <td><input type="text" name="u_name" > maxlength="16" value=""></td> > </tr> > <tr> > <td class="label">Password:</td> > <td><input type="password" name="p_word"></td> > </tr> > <tr> > <td></td> > <td class="submitIt"><button type="submit" > class="btSubmit0">Login</button></td> > </tr> > <tr> > <td colspan="2"><a > href="http://account.fotolog.com/ > forgot_password">Forgot your password?</a></td> > </tr> > </table> > --------------------------------------------------------------------------------------------- > > I need to automate the typing in user name and password, followed by > clicking on login button. > > I have tried following sets of codes, but it didn't work. > > 1. Accessing text type fields using aftertext attribute > > $ie.text_field(:aftertext,/Username:/).set("user1") > $ie.text_field(:aftertext,/Password:/).set("pwd1") > $ie.button(:text,"Login").click > > 2. Accessing text fields using name attribute > > $ie.text_field(:name,"u_name").set("user1") > $ie.text_field(:name,"p_word").set("pwd1") > $ie.button(:text,"Login").click > > Am getting following error: > ============================================================ > WIN32OLERuntimeError: focus > OLE error code:800A083E in htmlfile > Can't move focus to the control because it is invisible, not > enabled, or o > f a type that does not accept the focus. > HRESULT error code:0x80020009 > Exception occurred. > c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.6/./watir/ > input_elements.rb:334:in > `method_missing' > c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.6/./watir/ > input_elements.rb:334:in > `set' > C:/natasha/RubyScripts/FinalAutomatedTests/minicard_fotolog.rb: > 54:in `test_a > _orderPlacement' > ============================================================ > > Thanks and regards, > Natasha --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Watir General" group. To post to this group, send email to [email protected] Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/watir-general -~----------~----~----~----~------~----~------~--~---
