QTP Certification Help

Selenium IDE

About Selenium IDE Language

  • The default language of Selenium.
  • A simple language looks similar to HTML and structured with 3 components.
  • Has limited support for variables, but no control structure.
  • Three core components
  • Actions - Are commands that actually does something.
  • Element Locators - tells Selenium which HTML element a command refers to.
  • Accessors - verify the state of the application to conform what is expected.

Example as below,
<tr>
     <td>open</td>------------------------- command / accessor
     <td>http://google.com/</td>----------- target / Element locators
     <td></td>----------------------------- value
</tr>
<tr>
     <td>type</td>
     <td>q</td>
     <td>Selenium documents</td>
</tr>
<tr>
     <td>clickAndWait</td>
     <td>btnG</td>
     <td></td>
</tr>
<tr>
     <td>clickAndWait</td>
     <td>//a/b</td>
     <td></td>
</tr>
 

Selenium IDE Actions

  • Are commands that actually does something.
  • Most action typically take one or two arguments: An element locator and a value.
  • Many actions can be called with the “AndWait” suffix.

    Examples:

    <tr>
         <td>click</td>
         <td>link=Employee Administrator</td>
         <td></td>
    </tr>
    <tr>
         <td>type</td>
         <td>username</td>
         <td>Concuradmin</td>
    </tr>

 

Selenium IDE Accessors

  • Verify that the state of application conforms to what is expected. This informs/notifies Selenium to expect an error after the next command is executed.
  • Have seven permutations:
    • waitFor and waitForNot (locator, pattern)
    • verify and verifyNot (locator, pattern)
    • assert and assertNot (locator, pattern)
    • store (argument, variable)

 

Examples:
<tr>
     <td>waitForElementPresent</td>
     <td>username</td>
     <td></td>
</tr>

<tr>
     <td>assertText</td>
     <td>select</td>
     <td>Select and Continue</td>
</tr>


Selenium IDE Issues

  • Selenium IDE
    • Is supported only by Mozilla Fire fox.
    • Can run only 1 tests at a time.
  • How do we test in other browsers ?
  • How to store / posts the test results to some controller ?
  • How do we group test cases to form a test suites ?

    Sol: Use Selenium core

  • How to use other languages like Java, Ruby, C# in selenium ?
    Sol: Use Selenium RC