top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Small Discussion About Watir?

0 votes
410 views

What is Watir?

Watir (Web Application Testing in Ruby, pronounced water), is an open-source family of Ruby libraries for automating web browsers. It drives Internet Explorer, Firefox, Chrome, Opera and Safari, and is available as a RubyGems gem.

Watir-classic makes use of the fact that Ruby has built in Object Linking and Embedding (OLE) capabilities. As such it is possible to drive Internet Explorer programmatically. Watir-classic operates differently than HTTP based test tools, which operate by simulating a browser. Instead Watir-classic directly drives the browser through the OLE protocol, which is implemented over the Component Object Model (COM) architecture.

The COM permits interprocess communication (such as between Ruby and Internet Explorer) and dynamic object creation and manipulation (which is what the Ruby program does to the Internet Explorer). Microsoft calls this OLE automation, and calls the manipulating program an automation controller. Technically, the Internet Explorer process is the server and serves the automation objects, exposing their methods; while the Ruby program then becomes the client which manipulates the automation objects.

Watir-webdriver is a modern version of the Watir API based on Selenium. Selenium 2.0 (selenium-webdriver) aims to be the reference implementation of the WebDriver specification. In Ruby, Jari Bakken has implemented the Watir API as a wrapper around the Selenium 2.0 API. Not only is Watir-webdriver derived from Selenium 2.0, it is also built from the HTML specification, so Watir-webdriver should always be compatible with existing W3C specifications.

Example:

browser = Watir::Browser.new :chrome

browser.goto 'google.com'
browser.text_field(title: 'Search').set 'Hello World!'
browser.button(type: 'submit').click

puts browser.title
# => 'Hello World! - Google Search'
browser.quit

Video for Watir

posted Feb 26, 2018 by anonymous

  Promote This Article
Facebook Share Button Twitter Share Button LinkedIn Share Button


Related Articles

What is Spina?

Spina is a CMS built upon the Rails framework. This guide is designed for developers with experience using Ruby on Rails.

To start using Spina CMS add the following line to your Gemfile:

gem 'spina'

Make sure you run the installer to get started.

rails g spina:install

The installer will help you setup your first user.

Then start rails s and access your admin panel at /admin.

Features

  • Beautifully simple
  • Extendable
  • Rails 5.0+
  • Open source
  • Wysiwyg
  • User friendly

Video for Spina CMS

https://www.youtube.com/watch?v=WfATzrdMEgE

READ MORE
...