Project

General

Profile

Bug #3009

Unable to enter a numeric value into the text field.

Added by shanth (shanth kumar) over 9 years ago. Updated over 8 years ago.

Status:
Third Party's Issue
Priority:
Normal
Assignee:
-
ruby -v:
N/A
[ruby-core:28944]

Description

=begin
In my web page there is a text field "Age".
I would like to enter age into that field.
I written a code such that
ie.text_field(:name,'age').set(25)
It it throwing below error
undefined method `length' for 123:Fixnum (NoMethodError).

But It is not throwing an error if I written the code as below
ie.text_field(:name,'age').set('25')
=end

History

#1

Updated by nobu (Nobuyoshi Nakada) over 9 years ago

  • Status changed from Open to Third Party's Issue
  • ruby -v changed from 1.8.6 to N/A

=begin

=end

#2

Updated by hgs (Hugh Sasse) over 9 years ago

=begin

On Thu, 25 Mar 2010, shanth kumar wrote:

Bug #3009: Unable to enter a numeric value into the text field.
http://redmine.ruby-lang.org/issues/show/3009

Author: shanth kumar
Status: Open, Priority: Normal
ruby -v: 1.8.6

In my web page there is a text field "Age".
I would like to enter age into that field.
I written a code such that
ie.text_field(:name,'age').set(25)

This looks to me like you are using the watir library.
This is not about ruby itself.

It it throwing below error
undefined method `length' for 123:Fixnum (NoMethodError).

But It is not throwing an error if I written the code as below
ie.text_field(:name,'age').set('25')

It is a text field. It expects text. Only the program receiving this input
can validate its input to be a number, and possibly only an integer.
If you must pass in a number, you can use .to_s to make it into a string.

Hope that helps
Hugh
=end

#3

Updated by hgs (Hugh Sasse) over 9 years ago

=begin

On Thu, 25 Mar 2010, shanth kumar wrote:

Bug #3009: Unable to enter a numeric value into the text field.
http://redmine.ruby-lang.org/issues/show/3009

Author: shanth kumar
Status: Open, Priority: Normal
ruby -v: 1.8.6

In my web page there is a text field "Age".
I would like to enter age into that field.
I written a code such that
ie.text_field(:name,'age').set(25)

This looks to me like you are using the watir library.
This is not about ruby itself.

It it throwing below error
undefined method `length' for 123:Fixnum (NoMethodError).

But It is not throwing an error if I written the code as below
ie.text_field(:name,'age').set('25')

It is a text field. It expects text. Only the program receiving this input
can validate its input to be a number, and possibly only an integer.
If you must pass in a number, you can use .to_s to make it into a string.

Hope that helps
Hugh

=end

Also available in: Atom PDF