Log

From LDTP

Table of contents

Syntax

log('<Message to be logged>','<tag>')

where tag can be any of these

debug  :

messages can be logged while executing in debug mode

warning  :

warning message can be logged

teststart  :

tag used to indicate the beginning of the test suite

testend  :

tag used to indicate the end of the test suite

begin  :

tag used to indicate the beginning of test case

end  :

tag used at the end of the test case

error  :

error messages can be logged with this message

pass  :

message will be logged on successful execution of the testcases

fail  :

message will be logged on if execution of testcases fail

NOTE:Messges for the Tags-begin,end,teststart and testend should not contain spaces in between

begin and end  : These keywords are to be used with the same logging message and at beginning and end of testscripts

teststart and testend  : These keywords are to be used with the same logging message and at the beginning and end of testcases


Description

Logs the message in the log.xml with the tag which can be viewed after the execution of scripts


Implementation

The required message will be logged into the log.xml on execution of scripts

It returns 1 on Success and 0 on error

Example

With Respect to Evolution:

1) log ('EvolutionSuite','begin')

execfile('evolution.py')

log ('EvolutionSuite','end')


2) With respect to Appointment-to check the checkbox,

In Try Block:

selecttab('dlgAppointment-NoSummary','ptlAppointment-Nosummary','1')

log ('Selecttab-In-Appointment','pass')

In except block:

print "Error"

log ('Selecttab','fail')


3) With respect to creation of vFolders

log ('Creation-of-vFolders','teststart')

Create_folder()

log ('Creation-of-vFolders','testend')


4) Log message showing success of some test case

from ldtp import *

You can log the message to start the test case before writing the test case as

log('Open a file' , 'teststart')

log('opening a file','pass')