Sunday 27 May 2012

Checkpoints in selenium

Check Points  @ Selenium IDE (ASSERTIONS)
·         Assertions  verifies that the state of the application confirms to what is expected
·         Assertions  can be added to the test case, irrespective of the IDE is in recording mode or not
·         Assertions  are classified into 3 types.
Verify
•Assert

WaitFor

Verify
Verify is used for validating the actual and expected values. If the actual and expected value matches. it resumes Execution , irrespective of pass or failure.
On Failure , It displyes the actual and expected behavior in the log and increase the error count by One
Example:-

Command
 Target            
Value
verifyTextPresent

Welcome to My Home Page
verifyText 
    //h2
Downloads


Assert
Assert is used for validating the actual and expected values. If the actual and expected value matches, it is treated as pass. Otherwise it is treated as a failure. . it stops Execution , if it is failure.
On Failure , It displyes the actual and expected behavior in the log and increase the error count by One

Example:

Command
Target          
                     Value
assertTitle
Downloads

assertTable
1.2.1
                Selenium IDE


WaitFor
WaitFor is used for validating the actual and expected values. If the actual and expected value matches, the controller will be transferred to the next statement immediately. Otherwise WaitFor command let the controller to wait till the actual and expected value matches or till the time out happens.
On failure, it displays time out error in the log and continues with next statement execution in the test case. For each failure error count increases by 1.
Example:

Command
  Target     
               Value
waitForElementPresent
     Welcome to My Home Page
waitForPageToLoad
                      30000

Thursday 24 May 2012

Debugging @ Selenium IDE


Execute Individual Commands
Double-click a command in Selenium IDE and it will be executed – it is very useful when you need to find in which steps the failure is.
Slowing Down the Execution

You can use the speed slider  to slow down how fast your test commands are executed. This can be helpful as you can watch the application under test while your tests are running and see any obvious issues that your tests are failing on.
Frequent use of Echo Command
You can easily track the steps details by frequent use of Echo method. This is going to be very handy in case of data driving through java Script or External Excel file or DB.
Once The Test is executed, you can track all data or Status in your log, where Echo is used

Use of Pause, Break and Step
You can pause your test at any time, either by clicking the Pause icon in the toolbar or by setting breakpoints. You can set a breakpoint by right-clicking on a command you want Selenium IDE to pause before executing, and selecting ‘Toggle Breakpoint’ from the context-menu.When Selenium IDE is paused, the Step icon becomes available. You can use this to execute one command at a time, which can be very useful when approaching a failure or working through a number of verification failures.

Set Start Point
If you have a really long test and it is failing towards the end, then you can set a start point so that you don’t have to run the entire test when you’re searching for the failure. To set a start point simply right click on the first command you want Selenium IDE to execute and click ‘Set / Clear Start Point’. You will see a small play icon appear to the left of your command.