Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Ruby
What method to define a random float
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Fan Jin, post: 4676374"] Hi: I've applied the watir API to login to a website and input a integer value into a textfield. According to my task is to test the website's responding time regarding to distinguished values, it needs to input a random number everytime. Thus, I've defined a random number by coding: @num = rand(5) This integer should not exceed than 5. However, I applied the Watir to write the variable to that corresponding textfield where I coded: $browser.text_field(:id, 'keyword_instance_SearchBidMax').set(@num) #The variable @num should be any integer which is between 1 and 5. However, it turned to the error message as following: D:/ruby/lib/ruby/gems/1.8/gems/firewatir-1.6.7/lib/firewatir/elements/text_field.rb:199:in `doKeyPress': undefined method `length' for 4:Fixnum (NoMethodError) Can you help me to figure it out please? Thanks. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Ruby
What method to define a random float
Top