Sunday, January 25, 2015

Tips on using Selenium-IDE to generate UI tests

My previous posts provides advanced use of exporting test cases generated from Selenium IDE to different languages and technologies. I thought of giving a guide to the basic use of test case exporting in Selenium IDE.

You can download and install Selenium-IDE plugin on FireFox from here.

Exporting test case

Once you have recorded a test using the Selenium-IDE, you can generate tests based on different languages and technologies.

  • Java / JUnit 4 / WebDriver
  • Java / JUnit 4 / Remote Control
  • C# / NUnit / WebDriver
  • C# / NUnit / Remote Control
  • Python 2 / unittest / WebDriver
  • etc

Exporting steps

  1. Goto File > Export Test Case As
  2. This will give a drop down menu with a list of possible languages and technologies as mentioned above.
  3. When you select one option, you will be prompted to save the test case. Save it with an appropriate name and correct file extension.

Use of element locators

When you generate test cases, you often need to refer to an element on the page. Each element often has several locators (css locators, xpath locators etc.) By default you might be provided with CSS locators by the Selenium IDE. But you might prefer to use an xpath locator of the element. 

This plugin helps you to get locators using xpath for different languages. (Java, Ruby, Python, C# etc.)


No comments:

Post a Comment