Project

General

Profile

Actions

Bug #3009

closed

Unable to enter a numeric value into the text field.

Added by shanth (shanth kumar) over 14 years ago. Updated over 13 years ago.

Status:
Third Party's Issue
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

Actions #1

Updated by nobu (Nobuyoshi Nakada) over 14 years ago

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

=begin

=end

Actions #2

Updated by hgs (Hugh Sasse) over 14 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

Actions #3

Updated by hgs (Hugh Sasse) over 14 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

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0