How can you say that ruby is very object oriented language?
Ruby is very object oriented. Everything is an object -- even things you might consider constants. This also means that the vast majority of what you might consider "standard functions" aren't floating around in some library somewhere, but are instead methods of a given variable.
Here's one example we've already seen:
3.times { puts "Hi!" }
Even though 3 might seem like just a constant number, it's infact an instance of the class Fixnum (which inherits from the class Numeric which inherits from the class Object). The method times comes from Fixnum and does just what it claims to do.
Here are some other examples
$ irb --simple-prompt
>> 3.abs
=> 3
>> -3.abs
=> 3
>> "giraffe".length
=> 7
>> a = "giraffe"
=> "giraffe"
>> a.reverse
=> "effarig"
This will help you for Automation Software Testing with Watir Tool(Ruby)
Thursday, January 20, 2011
Web Application Testing in Ruby:WATIR and selenium ?
Web Application Testing in Ruby: What is the difference between WATIR and selenium ?
Watir
•It’s a Ruby library
•Multi browser (& OS) support
•Has a rich API
•Has a ‘Simple’ class (for non-tech users)
•Watij & Watin (Java & .NET)
•Have to learn Ruby (unless you choose Watij or Watin)
•Every browser requires a different library
Selenium
•Multi browser, OS & language support
•Install server-side or as FF add-on
•Has its own IDE
•Record and playback tests
•Have to learn a vendorscript => Selenese (Unless you write tests in another language which it supports. Then you just have to use the API reference which is straightforward.)
Thanks,
Shahadat Khan
Watir
•It’s a Ruby library
•Multi browser (& OS) support
•Has a rich API
•Has a ‘Simple’ class (for non-tech users)
•Watij & Watin (Java & .NET)
•Have to learn Ruby (unless you choose Watij or Watin)
•Every browser requires a different library
Selenium
•Multi browser, OS & language support
•Install server-side or as FF add-on
•Has its own IDE
•Record and playback tests
•Have to learn a vendorscript => Selenese (Unless you write tests in another language which it supports. Then you just have to use the API reference which is straightforward.)
Thanks,
Shahadat Khan
Subscribe to:
Posts (Atom)