Articles

Title Body
How to create popup boxes that require manual input

Here is how you can create three different input boxes in your script that require manual input for the script to proceed further:

Selenium Documentation and User Extensions

Many of us continue to use Selenium IDE and its stable working extensions. However, since the openqa site was removed/closed, there really isnt a repository of those extensions for us to go to.

How to get the BaseURL value in a script
<tr>
  <td>storeEval</td>
  <td>selenium.browserbot.baseUrl</td>
  <td>MyBaseUrl</td>
</tr>
<tr>
  <td>open</td>
  <td>${MyBaseUrl}</td>
  <td></td>
</tr>
Xpath query to select a row where column 1 and column 3 contain specific data

I needed to select a row from a table where the row contained specific data in two different columns of the same row. Here is the table of data I needed to select the row from:

 

A good article on extending selenium server with custom commands

http://crashingdaily.wordpress.com/2009/09/13/extending-selenium-server-...

Add Jquery (Sizzle) selectors to Selenium

First, download Sizzle, which is a selector engine for jQuery and unpack sizzle.js to a convenient location.

Second, create empty user-extensions.js file. Name can be whatever you want by the way.

Good article on adding custom commands to Selenium

http://www.codediesel.com/testing/adding-custom-commands-to-the-selenium...

storeElementIndex based on column content

I wanted to store the element index number (i.e., what number table row it is) of the Fac_No value for the Catonsville Elementary school (i.e, Fac_No=0101) in the table below so that I could further store the address data from the rest of the cells on the same row (a cheap join method ...

Great Firefox Addons for Selenium Testing
  • AutoAuth 2.1 (Allows me to automatically authorize Windows Authentication on sites)
  • Remember Certificate Exception 4.0 (Allows me to ignore the certificate exceptions and avoid dealing with the pop-up box for them)
  • Firebug (Super helpful testing tool)
Using the Perceptual Difference (Pdiff) Tool

Instructions for setting it up:

Setting up and Automation Friendly Firefox Profile

Step – 1: Create a Firefox profile that you want to use with selenium

Selenium Automation Element Identification Options

Selenium Automation Element Identification Options

Another example Selenium RC DOS Batch file

Below is an example of how the test script DOS batch file is currently configured:

Adding User-Extensions to the Selenium RC server JAR file

I had trouble using the -userExtensions parameter in my RC batch file for including user-extensions.

Adding Custom Formats

By default, Selenium IDE can save test cases with HTML or Ruby script. You can add any format you like by writing JavaScript code.

In this tutorial, we will add a simple CSV format.

Writing extensions

You can extend functionalities of Selenium IDE with JavaScript. There are 2 types of scripts in Selenium IDE - formats and extensions.

 

Locator for Links Wrapping HTML Tags (enclosingLink locator)

This locator REQUIRES release 1.0 (tested with Beta 2). It WILL NOT work with the 0.8.7 or early releases of SIDE.

Ordering Locators

You may find that you need a different order for the locators (whether or not you add new ones).

To do this, make a .js file containing this line:

Options for Off The Shelf Web Query Tools

<p>This page catelogs a list of web-based MSSQL query tools that could be used to assist in real-time dynamic data driven testing for Selenium IDE or RC.

Options for Data Driven testing with Selenium IDE and RC

Listed below are some options for how to handle data driven testing with Selenium IDE or RC

Option 1 – “Sel Blocks” Add-on for Firefox

Example of how to test table sorting using the JavaScript substring function

This is an example of how to:

How to storeText for a DIV element with a specific CSS class name, where the DIV contains a specific text string

The page looked like this with a red arrow for the value that needed to be stored:

Setting up Eclipse for Selenium Webdriver

I copied these steps from: http://assertselenium.com/2012/10/28/how-to-setup-a-webdriver-project-in... just in case that article dissappears (not to claim credit).

Sources for using Image comparison for testing
  1. http://code.google.com/p/fighting-layout-bugs/
  2. sikuli
  3. phash.org

Articles on getting Selenium RC to capture screen shots for Firefox and IE:

gotoif stored variable matches a text pattern

A simple script to parameterize your tests. Create a testsetup page (I use the Drupal CMS for this type of web content to drive Selenium IDE & RC tests), and provide tablized parameters like such:

Write content to a hidden input field example

Here is an example of how to write to a hidden input field using the Selenium IDE.

Use the RunScript command with the following javaScript:

DOS Batch file resources

This article is a collection of internet articles on DOS batch files that may help with utilities for cleaning up Selenium report files over X number of days and things like that:

How to click element 1 when element 2, in the same row, contains specific text
How to write to the selenium log file

<tr>    <td>storeEval</td>    <td>LOG.info(storedVars['doiPoints']);</td>    <td></td></tr>

Capture JavaScript Errors from Browser Console

A list of articles as leads on how to accomplish this:

Example Selenium RC Batch File

Use notepad to create a file named whatever you like, but using the .bat file extension. i.e.,

myexamplebatchfile.bat

Copy and paste the code below into the file:

Using Selenium Locators
TARGETING ELEMENTS WITHIN A HTML DOCUMENT


With the Selenium IDE, there are various ways of targeting an element or groups of elements within the HTML document.

In this course, I would focus mainly on the methodologies that are most efficient.
Selenium Reference

Selenium Reference

  1. Concepts
    1. Element Locators
    2. Element Filters
    3. String-match Patterns
  2. Selenium Actions
  3. Selenium Accessors
  4. Parameter Construction and Variables
  5. Whitespace Rules
  6. Extending Selenium
How to get Platform and Browser information using the IDE

Here it is:

 

An Example of Looping Through URL's

Here is an example script of how to loop through a list of URL's, perhaps looking for an error.

 

Pages