UI-Element Release 0.5

There are three main changes in this release.

First, the arguments in UI element argument lists will now appear in alphabetical order. This gives some consistency and makes long strings easier to read.

Second, the fuzzy matching algorithm (if I may use so fancy a word) now considers a page element to match a defined UI element if the UI element has an onclick attribute, and the page element is a descendant of the UI element. So for example, if my UI element xpath is:

//table[@class='listing']/tr

and the clicked-on element was actually the text highlighted in red:

<table class="listing">
    <tr onclick="showInfo()">
        <td>Samuel Barber</td>
        <td><em>Adagio for Strings</em></td>
    …

a match will be found.

The third and probably most impressive change is the introduction of a new Selenese command, takeScreenshot. Use it like this (the syntax of the path will depend on your environment):

takeScreenshot /home/chai/shot.png  
takeScreenshot C:\shot.png  

This works in Selenium IDE and for chrome browsers only. The code is adapted from the Screengrab! extension, and is attributed as such. The entire visible contents of the page are captured to a <canvas> element, then saved to a PNG file from a data URL.

In my integration effort, taking a screenshot before executing each command is a configurable option. There’s a specific reason why I say before executing each command - if any commands are executed between a command that causes an alert or confirmation dialog to appear, and the assertion on that dialog appearing, the assertion command will fail. This is because the dialog somehow is dismissed by the test runner. This applies to any commands, including highlight.

Overall, it’s pretty damn awesome to be able to capture a visual representation of a testcase run. Download links:

selenium-ide-0.8.7-ui-0.5.xpi
selenium-ide-0.8.7-ui-0.5-test.xpi

Leave a Reply


Bad Behavior has blocked 824 access attempts in the last 7 days.