Hi ,
there are many way you can get Fail log

1.Its Simple way Use out Parameter

eg.
Function fn_Division(iDivident,iDivisor,ByRef sMsg)
if iDivisor = 0 then
sMsg="Fail : Division cann't possible"
fn_Division=False
Else
if iDivisor < 0 then 'Assuming you have another condition "It should not be
-ive"
sMsg="Fail : Division cann't -ive value"
fn_Division=False
Else
fn_Division=iDivident/iDivisor
End If
End If
End Function

1. Dim sMsg
sMsg=""
bReturn=fn_Division(10,5,sMsg)
Msgbox bReturn &" "&sMsg

2. Dim sMsg
sMsg=""
bReturn=fn_Division(10,-5,sMsg)
Msgbox bReturn &" "&sMsg

2. Dim sMsg
sMsg=""
bReturn=fn_Division(10,0,sMsg)
Msgbox bReturn &" "&sMsg


-- 
Thanks  & Regards
Sujit :)

On Mon, Oct 15, 2012 at 11:00 AM, udhaya kumar
<[email protected]>wrote:

> Hi All,
>
>
>                 i am writing some fail log inside every function. How can
> i get the fail log in variable out side of that function.
>
> Ex:
>
> Public function Validation_for_Transfer_State_LP1_TB
>  SwfWindow("KLA-Tencor Common Application").SwfWindow("E87UI
> Dialog").SwfLabel("Transfer_State").RefreshObject
> Transfer_State= SwfWindow("KLA-Tencor Common
> Application").SwfWindow("E87UI
> Dialog").SwfLabel("Transfer_State").Object.Text
> If Transfer_State = "TransferBlocked" Then
>            Call Write_Log("Pass","Transfer State is Transfer Blocked")
> Else
>            Call Write_Log("Fail","Transfer State is  not Transfer Blocked
> ")
>    Exec_Result= False
> End If
> End Function
>
>
> now i need to get that text in variable if it is failed. Because i need to
> collect all the fail logs and i have to write in excel file.
>
>
> Thanks,
> Udhay
>
> --
> You received this message because you are subscribed to the Google
> "QTP - HP Quick Test Professional - Automated Software Testing"
> group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/MercuryQTP?hl=en
>

-- 
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en

Reply via email to