Hi Vamsi,
See the Driver script and using QC.
' Script Name: VAF_S2K_Driver_Script
' Created by: Byzoor
' Date: 03.04.2009
'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
' Modified log
'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
' Date:
Modifiyed by
Comments
' 10.03.2009
Driver script
'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
' Check the Quality center connection
StartTime =Now
CurrDate= F_FormatDateTime(StartTime,"HeaderDate")
CurrTime=F_FormatDateTime(StartTime,"HeaderTime")
Call F_ReportFileHeader(CurrDate,CurrTime)
TotalTC=0
PassVariable=0
FailVariable=0
Dim FailTC()
Dim PassTC()
If QCUtil.IsConnected then
Reporter.ReportEvent 0, "Connected", "http://qc/qcbin " +
QCUtil.QCConnection.ServerName + chr (13) +"SBSA_AUTOMATION_PROJECT: "
+ QCUtil.QCConnection.ProjectName + chr (13) + "SBSA_AUTOMATION: " +
QCUtil.QCConnection.DomainName
'Call ReportSuccess("QC Connection","QC is
connected sucessfully")
'Call ReportSuccess("Quality Center connection is
establised")
Else
Reporter.ReportEvent 1, "Not connected", "Not
connected to Quality Center"
'Call ReportFailure("QC Connection","QC is NOT connected ")
'Call ReportFailure("Quality Center connection is
NOT establised")
'Msgbox "Quality Center is not yet connected."
ExitT(0)
End if'If QCUtil.IsConnected then
' StartTime =Now
' CurrDate= F_FormatDateTime(StartTime,"HeaderDate")
' CurrTime=F_FormatDateTime(StartTime,"HeaderTime")
' Call F_ReportFileHeader(CurrDate,CurrTime)
DataSheetName=Trim(Environment.Value("ActionName"))
'Call fQuickSummary("001","Pass","Test",Result_Path,"")
'Call fQuickSummary(ApplicationName,"Pass",ActionName,Result_Path,"")
'Importing the Data Sheet
DataTable.ImportSheet "[QC-ATTACH];;Subject\SBSA AUTOMATION\VEHICLE
AND ASSET FINANCE\S2K\DATA;;\Driver_VAF_S2K.xls","Main",DataSheetName
Rowcount = DataTable.GetSheet(DataSheetName).GetRowCount ' Getting
The Row count
For i = 1 to Rowcount
DataTable.GetSheet(DataSheetName).SetCurrentRow(i)
Control=Trim(DataTable.Value("Control",DataSheetName))
If Control = "1" Then
'URL
URL=DataTable.Value("URL",DataSheetName)
Exit For
End If'If Control = Input Then
' DataTable.SetNextRow
Next ' Loop to Get the URL and Login Details
'Calling the Common Function LIb for the Execution
'Executefile ("[QC-ATTACH];;Subject\SBSA AUTOMATION\HOME
LOAN\ILO\LIB;;\UserFunction_VAF.vbs")
'Executefile ("[QC-ATTACH];;Subject\SBSA AUTOMATION\HOME
LOAN\ILO\LIB;;\UserFunction_ILO.vbs")
'===========================================================================================================================================================================
'Invoke Application
'===========================================================================================================================================================================
If Trim(UCase(URL))<>"" Then
SystemUtil.Run "C:\Program Files\Standard
Bank\NT2000\Bin\NT2000.exe","",URL,"open"
'SystemUtil.Run "iexplore.exe",URL
'
Browser("Internet banking").Page("Internet banking").Sync
End If ' If URL<>"" Then
'==========================================================================================================================================================================
' Importing Scenario_Details Sheet
DataTable.ImportSheet "[QC-ATTACH];;Subject\SBSA AUTOMATION\VEHICLE
AND ASSET
FINANCE\S2K\DATA;;\Driver_VAF_S2K.xls","Scenario_Details",DataSheetName
Rowcount = DataTable.GetSheet(DataSheetName).GetRowCount ' Getting
The Row count
For i = 1 to Rowcount
DataTable.GetSheet(DataSheetName).SetCurrentRow(i)
Ctrl=DataTable.Value("Control",DataSheetName)
If Ctrl = "1" Then
Environment.Value("ScenarioNumber")=DataTable.Value("Scenario_Number",DataSheetName)
Environment.Value("Scenario_Id")=DataTable.Value("Scenario_Number",DataSheetName)
& " _" & Datatable.Value("Testcase_Id",DataSheetName)
Environment.Value("ScenarioStatus")=""
Environment.Value("ScenarioName")=DataTable.Value("Scenario_Name",DataSheetName)
'Environment.Value("ScenarioNumber")=DataTable.Value("Scenario_Number","Driver")
FunctionalFlow=DataTable.Value("Functional_Flow",DataSheetName)
FunctionalFlowCollection=Split(FunctionalFlow,",")
FunctionalFlow=DataTable.Value("Functional_Flow",DataSheetName)
'
FunctionalFlowCollection=Split(FunctionalFlow,",")
For j = 0 to UBound(FunctionalFlowCollection)
'Loading the
Environment variable data of the Navigation scripts details
DataTable.AddSheet "Results"
DataTable.ImportSheet "[QC-ATTACH];;Subject\SBSA AUTOMATION\VEHICLE
AND ASSET FINANCE\S2K\DATA;;\Driver_VAF_S2K.xls","Results","Results"
Environment.LoadFromFile("[QC-ATTACH];;Subject\SBSA AUTOMATION\VEHICLE
AND ASSET FINANCE\S2K\LIB;;\VAF_S2K_Navigation_new.xml")
If FunctionalFlowCollection(j)<> "" Then
NavigationNo="n"&Trim(FunctionalFlowCollection(j))
Call ReportSuccess( "The Script NavigationNo:","NavigationNo :
" &NavigationNo)
'Retriving the Script name from Environment variable
NavigationScriptName=Trim(Environment.Value(NavigationNo))
If
NavigationScriptName<>"" Then
ScriptName = NavigationScriptName & " [" &
NavigationScriptName & "]"
Call ReportSuccess("ScriptName","The script
name is :"&ScriptName)'&vbcrlf&"The Script
NavigationNo:"&NavigationNo)
RunAction ScriptName, oneIteration
End If'If
NavigationScriptName<>"" Then
End If'If
FunctionalFlowCollection(j)<> "" Then
Call
F_CustomReports()
Next
' Call F_CustomReports()
'DataTable.DeleteSheet "Results"
'Call F_CustomReports()
DataTable.DeleteSheet "Results"
TotalTC=TotalTC+1
If Trim(Environment.Value("ScenarioStatus"))=
"Fail" Then
If
FailVariable<>0 Then
FailedTcName=FailedTcName&" ,"&
Environment.Value("Scenario_Id")
Else
FailedTcName=Environment.Value("Scenario_Id")
End
If
FailVariable=FailVariable+1
End If
If Trim(Environment.Value("ScenarioStatus"))=
"Pass" Then
If
PassVariable<>0 Then
PassedTcName=PassedTcName&" ,"&
Environment.Value("Scenario_Id")
Else
PassedTcName=Environment.Value("Scenario_Id")
End
If
PassVariable=PassVariable+1
End If
End if 'If Ctrl = "1" Then
Next
'calling the Logout script
'RunAction "Logout [Logout]", oneIteration
'Call
F_ExecutionReport(TotalTC,PassVariable,FailVariable,PassedTcName,FailedTcName)
Call
F_ExecutionReport(TotalTC,PassVariable,FailVariable,PassedTcName,FailedTcName)
Call F_UploadFilesToQC (Environment.Value("ReportFilePath")
,"Subject\SBSA AUTOMATION\VEHICLE AND ASSET FINANCE\S2K\REPORT")
'RunAction "Logout [Logout]", oneIteration
'Opening Customized Report at the end of test run
reportpath = Environment.Value("ReportFilePath")
Set ie = CreateObject("internetexplorer.application")
ie.Navigate reportpath
ie.Visible=True
Set ie = nothing
'#####################################################################################################################################################################################
--
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