Forum: Ruby on Rails how to handle javascript with watir

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
9a206eec7f985c5336abae0a4d502268?d=identicon&s=25 Lucas (Guest)
on 2009-05-19 17:50
(Received via mailing list)
html code:
<script language="javascript" type="text/javascript">
  document.write('<input name="TPL_password" id="TPL_password"
type="password" maxlength="20" size="32" tabindex="2"/>)
</script>

my question:

    how to locate the password field with watir?
68814ed988eee4f21b2cd07353e5e445?d=identicon&s=25 Mk 27 (mk27)
on 2009-05-19 18:10
Lucas wrote:
> html code:
> <script language="javascript" type="text/javascript">
>   document.write('<input name="TPL_password" id="TPL_password"
> type="password" maxlength="20" size="32" tabindex="2"/>)
> </script>

Someone warned me yesterday that the language="javascript" part is
deprecated and should no longer be used. So I thot I'd pass that on.

But sorry, I've never used watir.  A shot in the dark would be to say
that 90% of this kind of thing involves the id=
5200414de6135b5752f1d99cb7fd5f66?d=identicon&s=25 Željko Filipin (Guest)
on 2009-05-20 12:58
(Received via mailing list)
This should work:

browser.text_field(:id, "TPL_password").set "not-the-real-one"

By the way, you will get more answers at
http://groups.google.com/group/watir-general/

Željko
This topic is locked and can not be replied to.