There are times, we hope rare, when we need to attach an Internet Explorer window where not all of the ready states are complete. Here is an example where the window contains several frames and one of the frames never gets beyond ready state ‘loading’. Watir‘s normal #attach method waits for the overall document to…
Read moreThere are times, we hope rare, when we need to attach an Internet Explorer window where not all of the ready states are complete. Here is an example where the window contains several frames and one of the frames never gets beyond ready state ‘loading’. Watir‘s normal #attach method waits for the overall document to…
Read moreI have been working on Ruby and Watir technologies for a while now. While enjoying the versatility of Watir (as evident from Željko Filipin’s Watir solution for playing pacman, http://zeljkofilipin.com/2010/05/29/play-google-pacman-with-watir/) – I realized that there are certain scenarios in which we do not have direct method for accomplishing a task. For example, when we have…
Read moreMentioned in an earlier post, roo is a great gem to use with watir to do excel validations. You can use roo to find values in specific cells or within a range of cells. Naturally, you would want to do your data analysis across a range of cells to avoid unnecessary work and lines of…
Read moreMentioned in an earlier post, roo is a great gem to use with watir to do excel validations. You can use roo to find values in specific cells or within a range of cells. Naturally, you would want to do your data analysis across a range of cells to avoid unnecessary work and lines of…
Read moreWATIR allows you to access elements based on pre-defined attributes. But there are some cases where a simple watir method cannot be used. Cases such as below: Case 1 – > There is an element that cannot be accessed using pre-defined attributes Case 2 -> There is no API for a particular HTML element Case…
Read moreRoo is a gem that lets you access contents of , 1> Excel Spreadsheets(.xls), 2> Open office spread sheets(.ods), 3>Excel’s new format .xlsx and 4>Google spreadsheets. Consider the following spreadsheet: The above spreadsheet can be accessed using the following code:
1 |
require 'rubygems' |
#Require the roo library in the script
1 |
require 'roo' |
# To parse an excel…
Read moreWhen doing automated testing, it’s common to run into a basic authentication window before you can access the application. WATIR can’t handle these authentication windows very well because it’s basically a modal popup with no associated DOM. That’s where AutoIT can be used to handle these authentication windows. You can use AutoIT to send basic…
Read moreIn Part I we moved a dragable element around in the client window. Often the element has a handle that is to be used to move it. Or the handle might be intended for resizing. Of course, we have to find the handle within the element we wish to move or resize. Using the IE…
Read moreIf your test case requires you to validate the text of a modal dialog, you can use the AutoIT function WinGetText.
1 2 3 |
Title = "message from webpage" IEText = ai.WinGetText(Title) puts IEText |
However, this method only works for IE modal popups. When using Firefox, the WinGetText function will output a nil. One possible solution around this is to highlight the text, copy it, send it…
Read more