QTP Certification Help

Selenium Environment, Data and Parameterization

What is Data file ?

It is an HTML file where data is stored in a tabular format. This avoids data value modifications in the Selenium core file.

It is comprised of 2 parts,

  • The Variable Name
  • The Data Value

    Example:
    <tr><td>username</td><td>admin</td></tr>
     

How to Open a File to read?

The open Command:

Syntax:

     open(target/Element locators, Value)

Example:
<tr>
     <td>open</td>     ---This is the command / accessor
     <td>http://www.google.com</td>     ---This is the target / Element locators
     <td></td>     ---This is the value
</tr>
 

How to store values which are present in Data File to Variables?

storeTableContent

This is a Java script function which can store values present in a table to user defined variables.

Syntax:
<tr>
     <td>storeTableContent</td>
     <td>tableDataName</td>
     <td>userDefined_Variable</td>
</tr>

Example:
<tr>
     <td>storeTableContent</td>
     <td>sAdmin_Report/0/1/.*/0</td>
     <td>sReportName</td>
</tr>
 

How to call Variables?

To call a variable, use the variable name inside a braces and put the Dollar symbol before the braces.

Syntax:
<tr>
     <td>command</td>
     <td>Locator</td>
     <td>${userDefined_variable1}</td>
</tr>

<tr>
     <td>command</td>
     <td>${userDefined_variable2}</td>
     <td></td>
</tr>
 

Selenium Environment Files

  Environment files are part of the Selenium frame work where we can find all the environment related stuffs in order to run a Selenium core file.

The Environment files and Data Files are inputs to the Selenium Scripts, which inturn talk to the Application.