Skip to content
MatthewWalker42 edited this page Oct 8, 2013 · 3 revisions

In order to properly use the SharpSauce library, you should have some tests ready to run or debug. One of the easiest ways to create an adequate test template of what you want to do is to use Selenium IDE.

Downloading and Installing Selenium IDE

First, you must download Selenium IDE. You can find Selenium's download page here. Notice that it is a Firefox plugin, meaning that it won't work in Chrome or Internet Explorer or any other browser. Once you have downloaded and installed Selenium IDE you can open it by clicking the "tools" tab on the Firefox menu and selecting "Selenium IDE". Alternatively, you can press ctrl+alt+S (On Windows machines). This will bring up the Selenium IDE interface.

Starting Selenium IDE

By default the red "record" button will be enabled, meaning that Selenium IDE will record your interactions in a Firefox browser until you click the record button. Performing any interaction in the browser such as clicking a link or typing something into a search bar and pressing enter will create two commands in Selenium IDE.

Understanding Selenium IDE

Interactions in the browser are translated to commands by Selenium IDE. Each command will have a command and target component. The command component describes the type of action that will be performed. For instance, the first command of every new test should always be "open". "Open" tells Selenium IDE to open a Firefox browser and navigate to a target webpage. The Target component is what the action will be performed on. For instance, if we wished to open up a browser to Google's homepage the command would be "open", and the target would be "/". The reason the target would only be "/" is because we would have to have "http://wwww.google.com" in the Base URL text box. Thus, the command "open /" with a base URL of "http://www.google.com" is the same as "open http://www.google.com/". However, targets are usually elements on a web application. So the target will rarely be something simple like "/". Instead a more likely value of a target would be "name=somename", or "css=a.anElement". The target value is the html code that defines the element on the web application.

The third component of a command is only necessary for certain commands such as "type". The type command needs a target which will usually be a text box and a value. The value is what Selenium IDE will enter into the text field.

Using Selenium IDE

Now that you can understand a little bit about what Selenium IDE is doing, you can have a better understanding of how to use it. With the record button on you can navigate a web application however you wish and Selenium IDE will automatically fill out the command box list with commands corresponding to your actions. When you wish to have Selenium IDE quit recording your actions simply click the record button to off. It should be noted that Selenium IDE will not always choose the best values to populate the target fields of commands. Because of this, if you try to have Selenium IDE rerun a test it may fail. An easy way to fix these problems is to manually edit the target values of the commands that failed. If you wish to record an action that Selenium IDE is unable to perform, such as switching to another Firefox browser and back, you can manually enter commands into Selenium IDE. To do this, simply right click a blank are of the command list box and select "insert new command". Alternatively you can click the area just below the last command entered and then click the command text field. If you wish to start a new Test Case simply right click the Test Case box and select new Test Case. To clear the command field box of commands right click it and select clear all. To export the commands generated through the test to a programming language suited for visual studio select the test you wish to export. Then click "file" and select "export test case as..." then select the language you wish to export it as.

Additional Tools

For more help with using Selenium IDE check out this tutorial.

An additional tool that may be useful for finding the correct value of target elements is Firebug. If you wish, you can download the appropriate Firebug version for your Firefox browser here.

Clone this wiki locally