I have it working like this:

password = 'abc123'
b.text_field(:name, "mock_password").set password

If that doesn't work, you might want to just test to see if watir can even
see that element.

if b.text_field(:name, "mock_password").exists?
  puts "Password field exists"
else
  puts "Password field missing"
end




On Wed, Oct 6, 2010 at 8:54 PM, Eric Mathiesen <mathiese...@gmail.com>wrote:

> Could also try .flash to ensure you are calling the right element from
> orb.  Css has given me some challenges in the past..  also try emwith
> (;index, #).set
>
> On Oct 6, 2010 6:35 PM, "blkjk" <blkjk....@gmail.com> wrote:
>
> I am trying to type text to a Login textfield. And when I use this
> code to access it:
>
>          $b.text_field(:name, 'mockPassword').set('abc123')        No
> password actually gets typed into the textfield and used for login.
>
> Here is what Firebug caught to identify the textfield:
> <input type="text"
>
> onfocus="jQuery('#mockPassword').hide();jQuery('#password').show();jQuery('#password').focus();"
> value="password" name="mockPassword" id="mockPassword" style="width:
> 150px; color: rgb(204, 204, 204);" class="input">
>
> Any thoughts on how to make the code type the password into that
> field? And yes, I wish to make it work on both IE8 & FF3.5 in Win7.
> Thanks for any help on this.
>
> --
> 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<http://groups.google.com/group/watir-generalwatir-general+unsubscr...@googlegroups.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<watir-general%2bunsubscr...@googlegroups.com>
>



-- 
CJ Romberger
Wildwood Interactive
http://www.wildwoodinteractive.com/
512.732.9916

PLEASE NOTE: I only check this email address about once a day!  If you're a
client, the fastest way to reach me is to login to Basecamp, OR email
supp...@wildwoodinteractive.com.

If you're NOT a client?  Why not become one!?  :)

-- 
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

Reply via email to