Monthly Archives: January 2013

Handling repeating blocks of related elements with enumerable collections

Background Have you ever had to automate a page that had repeating blocks of related elements? It might have been as simple as a table, which is a collection of tr elements (the blocks) that contain td elements (the related … Continue reading

Posted in Watir, Watir-Classic, Watir-Webdriver | Tagged , , | Leave a comment

Checking if a number is within a range

I had been looking at a StackOverflow question where part of the solution required checking if a number was within a range. Seeing the answers to this and other questions, I learned a couple of new, more Ruby-like, ways to … Continue reading

Posted in Ruby | Tagged | Leave a comment

Increasing performance using table.trs instead of table.rows

Background I was automating a page today where clicking a button would append a row to the end of a table. The script then needed to input the text fields in the newly created row. A relatively simple task with … Continue reading

Posted in Watir, Watir-Classic, Watir-Webdriver | Tagged , | 1 Comment

Formatting table for text files

Problem I am often copying tabular data from an application (ex Excel) into a text file. The problem is that the table pasted into the text file is tab (or sometimes comma) delimited. Depending on the values, the columns may … Continue reading

Posted in Automation | Tagged , | Leave a comment

Get the css class name of an element

Problem Based on the WordPress stats, it looked like someone had visited my blog while trying to determine how to get the css class name of an element. While I knew how to do this in watir-classic, I could not … Continue reading

Posted in Watir, Watir-Classic, Watir-Webdriver | Tagged , | Leave a comment