If you want to go ahead and change your copy of watir.rb, just go ahead and do it. Just edit your file. There is no compiling or anything that you need to do other than that.

However, in the specific case you mention, Watir already has the functionality you want. Try ie.text_field(:name, /nameTextBox$/).set("whatever")

Bret

On 2/9/06, Brian Vallelunga <[EMAIL PROTECTED] > wrote:
I have been using Watir for two days now and want to know about how to
modify the source watir.rb file. I installed the one-click install of
Watir. What did that do exactly? Does it install pre-compiled files, or
is everything source-based?

What I'm trying to do is modify the watir.rb file so that I can more
easily use Watir with asp.net output. In much of my work, the name for a
given text box will look something like this:

ctl00$ctl00$TabPageContent$MainContent$ApplicationPage_UserDetails$nameT
extBox

What I'm really after is the last part of the name. In this case,
"nameTextBox." While my "nameTextBox" won't change, the full name of the
control will change if I rename anything higher up in the control tree,
thus forcing me to do search and replaces for all of my watir scripts.

So where do I actually go about modifying the Watir source? I downloaded
the full source, but have no idea how to go about using my modified
version rather than the installed version.

It seems as though the key is in line 828 of watir.rb (version 1.4).
Instead of matching the name or id attribute argument to the current
object's name, I can have it match just the end of the string. Of
course, I'm not sure how to go about doing that just yet, but I have a
Ruby book on arrival today.

Thanks for any help.

Brian

_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to