Don't use element_by_xpath. If you want a text field, pass the xpath
to Browser#text_field:

browser.text_field(:xpath, "/your/xpath").set("foo")

Again, reading the docs would show you on what elements the #set
method is defined (e.g. not on Watir::Input).


On Tue, Nov 9, 2010 at 5:04 PM, Usman Hussain <[email protected]> wrote:
> Hi Guys,
>
> I am trying to set a text field with the method set and it doesnt seem
> to be working anymore.
>
> The error im getting is: `set' for #<Watir::Input:0x102204a38>
> (NoMethodError)
>
> I am using Watir-WebDriver (version 0.1.1) and firefox as the browser.
>
> My line of code is:
> @browser.element_by_xpath("//d...@id= 'container']//div//inp...@value=
> 'starofjoy.display']/../input[2]").set("true")
>
> If I use send_keys instead of set then i end up with the text field
> looking something like this:
> falsetrue
>
> BUT all i want is to change it from False to True...
>
> has anyone else come across this problem?
>
> Kind regards,
> Usman Hussain
>
> --
> Before posting, please read http://watir.com/support. In short: search before 
> you ask, be nice.
>
> [email protected]
> http://groups.google.com/group/watir-general
> [email protected]
>

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

[email protected]
http://groups.google.com/group/watir-general
[email protected]

Reply via email to