Author: admin

  • Headless Testing

    In this chapter, we will learn how to use headless option of the Watir webdriver to test the page url. Syntax Browser = Watir::Browser.new :chrome, headless: true Output Watir code We have added the option headless : true to the Watir chrome browser. When you execute the Ruby program, it will not open the browser, everything will…

  • Automatic Waits

    In this chapter, let us understand waits in detail. To understand automatic waits, we have created a simple test page. When user enters text in the textbox onchange event is fired and after 3-seconds the button is enabled. Watir has a wait_unit api call which waits on a particular event or property. We will test the same…

  • Working with Iframes

    Watir offer easy to use syntax to work with iframes. Syntax browser.iframe(id: ‘myiframe’) // will get the reference of the iframe where we want to input details. To understand how to deal with iframes and locate the elements inside an iframe, in this chapter, we will work on an example. Example main.html test1.html Output In…

  • Locating Web Elements

    In Watir for testing, you need to locate the elements and it can be done in different ways – by using the id, class or text of the element. In this chapter, we will see few examples which shows different ways to locate elements. Using ID of the Element Test page Example In this example,…

  • Locating Web Elements

    In Watir for testing, you need to locate the elements and it can be done in different ways – by using the id, class or text of the element. In this chapter, we will see few examples which shows different ways to locate elements. Using ID of the Element Test page Example In this example,…

  • Working with Browsers

    By default, Watir will open chrome browser in-case the browser name is not specified. The required browser drivers are installed along with Watir installation. In case you face any issues working with browsers, install the driver as shown in the Browsers drivers chapter and update the location in PATH variable. In this chapter, we will…

  • Installing Drivers for Browsers

    In this chapter, we are going to install browser drivers that we need to test our project using Watir. Prior to Watir 6, we had to include watir-webdriver to use the browser drivers. With the release of Watir 6, the watir-webdriver is available as part of Watir package and users do not have to add the watir-webdriver separately. The browsers like…

  • Environment Setup

    To work with Watir, we need to install the following − Since Watir is build using Ruby, we need to install Ruby and gem (package manager for Ruby). Ruby Installation on Windows To install Ruby on Windows, go to − https://rubyinstaller.org/downloads/ Install the ruby version based on your 32 or 64 bit operating system. Here we…

  • Introduction

    Watir (Web Application Testing in Ruby) pronounced as “Water” is an open source tool developed using Ruby which helps in automating web application no matter which language the application is written. Watir comes with a rich set of APIs which helps us interact with the browser, locate page elements, take screenshots, work with alerts, file downloads, window.open popup…

  • Overview

    Watir (Web Application Testing in Ruby), pronounced as “Water” is an open source tool developed using Ruby which helps in automating web application that suits applications developed in any programming language. The browsers supported for Watir installation Internet Explorer, Firefox, Chrome, Safari, and Edge. Watir is available as Rubygems for installation. Watir will connect to…