Micro Focus QTP (UFT) Forums
QTP Not accepting method directly - 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: QTP Not accepting method directly (/Thread-QTP-Not-accepting-method-directly)



QTP Not accepting method directly - dlaureano - 02-06-2013

I'm trying to do a keyword driven framework and the Function where I call the different actions has different Case depending on the action I want to perform. What I have to do to eliminate the Execute Command?

The control_object variable has the the hierarchy similar or equal to (Browser(arrParentProp(0)).Page(arrParentProp(1)).Frame(arrParentProp(2)).WebButton(arrParentProp(3))

Why QTP is not only accepting ->->-> control_object.click
here is part of my code;
If you want to see all the function library see the attachment please.

Code:
            Case "Click_Link"
                sExec = control_object & ".click"                                                
                Execute (sExec)
                
            Case "Click_WebButton"                                                            
                sExec = control_object & ".click"
                Execute (sExec)

'Same thing happen with every case, for example *****
Case "Run"
                    sExec = "systemutil.Run" & sDataValue
                Execute (sExec)
                Browser("Main").Page("Main").Sync
                Browser("Main").Page("Main").WebList("Environment").Select "System Integration (UAT)"


Thanks,
Daniel Laureano
a Friend from Puerto Rico.