Selenium IDE File Logging

I have just found this Plugin that allows the user to write the Selenium IDE Log to a file. Please read this article for more information.
This plugin for Selenium-IDE saves log messages to a file in real time at a user selectable log level. Once this plugin is installed, a FileLogging tab will be added to the options dialog and a FileLogging menu will be added to the log pane.

This version brings a bunch of user experience improvements and some internal improvements. See the screen shot for details. The current settings are also saved and will be retained if you restart the Selenium IDE or Firefox.

Mini user guide for the plugin
Set the log file name and the log level from the Options dialog (FileLogging tab) of the Selenium IDE.
You can open the FileLogging tab of the Options dialog directly by selecting the Show options menu item from the FileLogging menu on the Log pane in Selenium IDE.
You can also set the log level for the log file directly from the FileLogging menu on the Log pane.
Set the log file name empty to stop writing to the log file.
The FileLogging menu on the Log pane will also show if FileLogging is on.

Download the plugin here

Selenium Keyword Driven Framework

In the implementation of the Keyword Framework Approach for testing a web application we can used Selenium IDE as the Record/Replay tool. Once you have the script you can then run the scripts using Selenium RC or Selenium Grid.
A typical script for automation involves a number of actions or steps on a web page. I this example we will look at automation of Google’s Gmail Login page.
Here are some of the steps
1. Open http://www.gmail.com
2. Enter “user id”
3. Enter “password”
4. Click on “login button”

To automate such a flow in a Record/Replay tool, the following steps have to be performed:
1. Open the Gmail webpage on the Firefox browser and use the Selenium IDE to record the steps mentioned above.
2. Once you have recored the script you have the option to save the script in the programing language of your choice i.e. Java, C#, PHP, Ruby.
3. The data for the script which include the element id and the test data have to be either stored in a data sheet or part of the script. The script must refer to this data sheet for relevant inputs
In writing such a script, a lot of functionality is routine, for example:
1. Opening a new browser window
2. Selecting the browser to run the test scripts.
3. Clicking on a links and entering the input data like username and password. Clicking on the login button.
4. Reading items from a data sheet, and using them as inputs for fields on the page. This can be done by creating a Object repository that reads the data from data sheets or defining the data in the object repository.

Example of store, storeEval and GetEval in selenium

Here is an example of using store and store eval in selenium in C# its GetEval

String SiteName = "Selenium Wiki";
String SiteName = selenium.GetEval("storedVars['SiteName'].substring(9);");
Console.WriteLine(SiteName);

The output will be Wiki

The HTML selenium code is as under:

store Selenium Wiki SiteName storeEval storedVars['incident'].substring(9); SiteName echo ${SiteName}

How did this solution work for you? Do you have a better alternative? Feel free to share your thoughts in comments section below.

Using User-Extensions With Selenium-IDE

User-extensions are very easy to use with the selenium IDE.
1. Create your user extension and save it as user-extensions.js. While this name isn’t technically necessary, it’s good practice to keep things consistent.
2. Open Firefox and open Selenium-IDE.
3. Click on Tools, Options
4. In Selenium Core Extensions click on Browse and find the user-extensions. js file. Click on OK.
5. Your user-extension will not yet be loaded, you must close and restart Selenium-IDE.
6. In your empty test, create a new command, your user-extension should now be an options in the Commands dropdown.