Micro Focus QTP (UFT) Forums
Function is not calling from subdriver - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Function is not calling from subdriver (/Thread-Function-is-not-calling-from-subdriver)



Function is not calling from subdriver - qtpexpert - 01-18-2013

Hi,

I am using Qtp11,windows7.I amusing Hybrid Framework for my project.
I have an issue in subdriver. function is not calling in subdriver
in the select statement.(Select case strObject).
Here is the code for driver and subdriver scripts.

Driver script
--------------
Code:
Option explicit
Dim strfilename,strAppMap,strCompMap,strSupportfns,strTestsuite,iRowcnt,strmsgfilepath,strTestCasefile,strreportfilepath
Dim i
strfilename=Environment.ExternalFileName
If strfilename="" Then
    Environment.LoadFromFile("D:\Proof Platform\Proof2.1\Testing\Automation Script\Configuration\GlobalFiles.xml")
End If

If(strfilename=Environment.ExternalFileName)<>"" Then
    strAppMap=Environment.Value("ApplicationMap")
    strCompMap=Environment.Value("ComponentMap")
    strSupportfns=Environment.Value("SupportFunctions")
    strTestsuite=Environment.Value("TestSuite")
    strmsgfilepath=Environment.Value("MessageFile")
    strreportfilepath=Environment.Value("TestReportPath")
End If
' Loading the test suite file content to Global Data Table
DataTable.ImportSheet strTestsuite,"Test","Global"
iRowcnt=DataTable.GetSheet("Global").GetRowCount
'DataTable.ImportSheet  "D:\Dinesh\QTP\Hybrid\Sample\TestSuite\TestSuite.xls","Tests","Action1"
For i =1 to iRowcnt step 1
    DataTable.GetSheet("Global").SetCurrentRow(i)
    strTestCasefile=DataTable.GetSheet("Global").GetParameter("TestFiles").ValueByRow(i)
RunAction "SubDriver [SubDriver]", allIterations, strTestCasefile, strAppMap, strCompMap, strSupportfns, strmsgfilepath, strreportfilepath
Next
ExitAction(0)
--------------------------------------------------------------------------
sudriver script
----------------
Code:
Option Explicit
On error resume next
Dim strComponent,strBrowser,strObject,strObjectName,strAction,strParam,strParam1,strParam2,strParam3,strExpected,strResult
Dim strDataFileParam,strLibParam,arrLibrarypath,strLibrarypath,str,strAppMapParam,strCompMapParam,strSupportfnsParam,strmsgfilepathParam,strReportFilePathParam
Dim intRowCount,i,cRow,testReport,sName

'getting parameter  value from the Driver
strDataFileParam=Parameter("strTestCasefile")
strAppMapParam=Parameter("strAppMap")
strCompMapParam=Parameter("strCompMap")
strSupportfnsParam=Parameter("strSupportfns")
strmsgfilepathParam=Parameter("strmsgfilepath")
strReportFilePathParam=Parameter("strreportfilepath")

'If strAppMapParam <> "" Then
'    ExecuteFile strAppMapParam
'End If
'If strCompMapParam <> "" Then
'    ExecuteFile strCompMapParam
'End If
'If strSupportfnsParam <> "" Then
'    ExecuteFile strSupportfnsParam
'End If
'If strmsgfilepathParam <> "" Then
'    ExecuteFile strmsgfilepathParam
'End If
    
'*********************************************************
'To incllude Library Files in the Sub Driver
'arrLibrarypath=split(strLibParam,",")
'For each strLibrarypath in arrLibrarypath
'    If strLibrarypath <> "" Then
'        ExecuteFile  strLibrarypath
'    End If
'Next
'*********************************************************
'Generating Test  Report
testReport =  fntestreport (strDataFileParam,strReportFilePathParam)
'Importing the Data File.xls
DataTable.ImportSheet strDataFileParam,1,"SubDriver [SubDriver]"
'DataTable.ImportSheet strDataFileParam,"Sheet1","SubDriver[SubDriver]"
'DataTable.ImportSheet strDataFileParam,"Sheet1","SubDriver[SubDriver]"
'SubDriver[SubDriver].Cells(1,9).value="PassFail"
'SubDriver[SubDriver].Cells(1,9).Font.colorIndex=10
intRowCount=DataTable.GetSheet("SubDriver [SubDriver]").GetRowCount
cRow=0
For  i=1 to intRowCount step 1
    'DataTable.GetSheet("ActionA").GetParameter("Destination").ValueByRow(4)
    DataTable.SetCurrentRow(i)
    strComponent=DataTable.GetSheet("SubDriver [SubDriver]").GetParameter("Component").ValueByRow(i)
    strBrowser=DataTable.GetSheet("SubDriver [SubDriver]").GetParameter("Browser").ValueByRow(i)
    strObject=DataTable.GetSheet("SubDriver [SubDriver]").GetParameter("Object").ValueByRow(i)
    strObjectName=DataTable.GetSheet("SubDriver [SubDriver]").GetParameter("ObjectName").ValueByRow(i)
    strAction=DataTable.GetSheet("SubDriver [SubDriver]").GetParameter("Action").ValueByRow(i)
    strParam=DataTable.GetSheet("SubDriver [SubDriver]").GetParameter("Param").ValueByRow(i)
    strParam1=DataTable.GetSheet("SubDriver [SubDriver]").GetParameter("Param1").ValueByRow(i)
    strParam2=DataTable.GetSheet("SubDriver [SubDriver]").GetParameter("Param2").ValueByRow(i)
    strParam3=DataTable.GetSheet("SubDriver [SubDriver]").GetParameter("Param3").ValueByRow(i)
    strExpected=DataTable.GetSheet("SubDriver [SubDriver]").GetParameter("Expected").ValueByRow(i)
    strChkpoint=DataTable.GetSheet("SubDriver [SubDriver]").GetParameter("Checkpoint").ValueByRow(i)
    Select Case strComponent
        Case "Web"
            Call fnAppMap (strBrowser,strObject,strObjectname)    
                Select Case strObject
                    Case "Browser"
                       Call  fnbrowser (WebBrowserDesc, WebPageDesc, strAction, strParam, strExpected)
                    Case "WebEdit"
                        Call fnedit(WebBrowserDesc,WebPageDesc,WebEditDesc,strAction,strParam,strExpected,strObject)
                    Case "MLWebEdit"
                        Call fnedit(WebBrowserDesc,WebPageDesc,WebEditDesc,strAction,strParam,strExpected,strObject)
                    Case "WebElement"
                        Call fnelement(WebBrowserDesc,WebPageDesc,WebElementDesc,strAction,strParam,strExpected,strObject)
                    Case "WebButton"    
                        Call fnbutton(WebBrowserDesc,WebPageDesc,WebButtonDesc,strAction,strParam,strExpected,strObject)
                    Case "WebButtonSW"    
                        Call fnbuttonSW(WebBrowserDesc,WebPageDesc,WebButtonDesc,strAction,strParam,strExpected,strObject)
                    Case "WebLink"    
                        Call fnlink(WebBrowserDesc,WebPageDesc,WebLinkDesc,strAction,strParam,strExpected,strObject)    
                    Case "WebList"    
                        Call fnlist(WebBrowserDesc,WebPageDesc,WebListDesc,strAction,strParam,strExpected,strObject)    
                    Case "WebListSW"    
                        Call fnlistSW(WebBrowserDesc,WebPageDesc,WebListDesc,strAction,strParam,strExpected,strObject)    
                    Case "WebCheckBox"    
                        Call fncheckbox(WebBrowserDesc,WebPageDesc,WebCheckBoxDesc,strAction,strParam,strExpected,strObject)           
                    Case "WebFile"    
                        Call fnfile(WebBrowserDesc,WebPageDesc,WebFileDesc,strAction,strParam,strExpected)            
                    Case "WebRadioGroup"    
                        Call fnradiogroup(WebBrowserDesc,WebPageDesc,WebRadioGroupDesc,strAction,strParam,strExpected,strObject)    
                    Case "WebTable"      
                        Call fnwebtable(WebBrowserDesc,WebPageDesc,WebTableDesc,strAction,strParam,strParam1,strParam2,strParam3,strExpected,strObject)
                    Case "Image"    
                        Call fnimage(WebBrowserDesc,WebPageDesc,WebRadioGroupDesc,strAction,strParam,strExpected,strObject)          
                    Case "Sleep"    
                        Call fnSleep(strAction,strParam)        
                    Case "Replay"    
                        Call fnReplay(strAction,strParam)
                    Case "InstAdd"    
                        Browser("PROOF").Page("PROOF").WebButton("ctl00$ContentPlaceHolder1$Proc").Click
                    Case "AddGridRow"    
                        Browser("PROOF").Page("PROOF").WebButton("ctl00$ContentPlaceHolder1$User").Click
                    End Select
        Case "DBCheck"
                    Call fndbcheck(strObjectname,strAction,strParam,strExpected)            
        End Select
Next
DataTable.ExportSheet testReport,"Report"
'Call fnsetcolor(strParam,strActual,strChkPoint,strObject)
'Call fnResColor(testReport)
ExitAction (1)

----------------------------------------------------------------------

My issue is during script execution qtp is not callling the functions which is avaialble in 'Select Case strObject' in subdriver script.

Till day before yesterday it was fine . From yesterday on wards i Had this problem.
any one know the solution kindly post the reply.
Thanks in Advance...