Sunday, November 27, 2016

How to run test with random data in Selenium IDE: store and storeText Command

Selenium IDE is a tool for record and play functionality, which runs the script with same set of data, however we can generate random data. store the values in a variable , and use the value stored in the variable in the later steps in the test.


Expected Learning from this article:

  • Store command to store random generated data in the a variable. 
  • Using the stored information in later steps in the test.
  • Using command storeText to store value of an object in the test and storing in a test.
  • Using the stored information in later stage in the test.



Below screenshot shows how to use store and storetext in the test:




  • In the above test, we open an application and save the text of the link in variable using command storeText. test in Value is the variable in each we can store the value of the link/object.
  • In the next step, we can use the value in the variable using ${variable_name} which is ${test} in our example.
  • Similarly using store command and javascript, we can generate random data, store in the variable and use further in the test.
  • We have saved the test in an html file and the test file looks as below:


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="selenium.base" href="https://www.google.co.in/" />
<title>testing stored value</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">testing stored value</td></tr>
</thead><tbody>
<tr>
 <td>open</td>
 <td>/search?q=selenium&amp;ie=utf-8&amp;oe=utf-8&amp;client=firefox-b-ab&amp;gfe_rd=cr&amp;ei=r4E6WIqnEeXI8AfOn6awBw</td>
 <td></td>
</tr>
<tr>
 <td>storeText</td>
 <td>link=Selenium - Web Browser Automation</td>
 <td>test</td>
</tr>
<tr>
 <td>type</td>
 <td>id=lst-ib</td>
 <td>${test}</td>
</tr>
<tr>
 <td>click</td>
 <td>name=btnG</td>
 <td></td>
</tr>
<tr>
 <td>store</td>
 <td>javascript{&quot;Selenium&quot; +Math.random();}</td>
 <td>testrandom</td>
</tr>
<tr>
 <td>type</td>
 <td>id=lst-ib</td>
 <td>${testrandom}</td>
</tr>
<tr>
 <td>click</td>
 <td>name=btnG</td>
 <td></td>
</tr>

</tbody></table>
</body>
</html>

Copy paste the code in a text file and save in html format. Open the test in Selenium Ide and try to run the test and understand how to run test with random data in selenium IDE.

Tuesday, November 22, 2016

Tutorials for Selenium IDE easy understanding


Selenium IDE :: Add-ons for Firefox - Download Selenium IDE from the link for
firefox. Remember Selenium IDE is add-on for firefox browser only.

Download Selenium IDE - Official site for Selenium. Can learn about selenium
IDE and release notes from this page.

Introduction to Selenium IDE - Guru99 - Excellent link to start understanding about Selenium IDE

Introduction to Selenium IDE (Installation and its Features) - Another interesting blog to understand the concept of Selenium IDE.

Useful tutorial Posts for Selenium IDE in this blog:


Mindmap for understanding Selenium IDE - Mindmap to understand what selenium IDE is all about. 

Installing Selenium IDE add-on in firefox - How to install Selenium IDE add-on in firefox.

Understanding and locating Locators in Selenium IDE - What are locators in Selenium IDE and how are locators used to identify an element in Selenium IDE

Log file for Selenium IDE execution using FileLogging addon for firefox - Log file are useful to identify failures in execution and validating the performance of application response.This article explains how to create log file for execution in Selenium IDE

Selenium Commands in Selenium IDE - This article explains what are the selenese commands most commonly used in Selenium IDE

Exporting selenium IDE tests to WebDriver - Test recorded using Selenium IDE can be imported into different languages support. This article explains how to export selenium IDE tests to Selenium WebDriver.

Selenium IDE Panes and Shortcut keys - This article explains the Interface of Selenium IDE with details of different panes and shortkeys for operations in Selenium IDE.

How to run test with random data in Selenium IDE: store and storeText Command - This article explains how to store information in application or using javascript, generating random data and storing in a variable.



Validating conditions using assert and verify in Selenium IDE -This post explains how to add assertions in Selenium IDE and what is the difference between assert and verify statement.

Friends, there may be many interesting blogs/post for Selenium IDE, which you have come across. Please feel free to ion share such links as can be useful for other readers.

Sunday, November 20, 2016

Installing Selenium IDE add-on in firefox

Selenium IDE is a record and play automation IDE/add-on with Firefox. It is very simple to install selenium IDE and creating automated script in selenium which can then be imported in different languages and formats. In this article, we will explain how to install Selenium IDE in firefox.
  • Pre-condition: Firefox browser is installed. 
  • Installation steps:
    • Search Selenium IDE and click on the link as shown below:
Selenium IDE link
    • Click on the link.In the add-ons Page, click on Add to Firefox
Selenium IDE add-on
developer selenium IDE
    • Once the add-on is installed, Selenium IDE can be accessed by navigating to developer>Selenium IDE or pressing Alt + Ctrl + S
    • This will open Selenium IDE on which we can record and play on the applications.