I need to know the difference b/w Function and classes in Qtp.In my Project we using Function Layer but wat s the Difference b/w for function and classes . and one more thing is Keyword Driven Architecture?
can somebody Explain about this two things
thanks a lot.
but can u share exact code for keyword driven architecture ..how we understand it as in our code ,
based on the function codes we can drag and drop the function name in the action itself , we thoughts its a keyword driven architect(i.e UserDefinedFunction to qtp )
I think the keyword driven framework enables the user/test professional to mention/write down the keywords on an excel sheet/file. The keywords from the excel are then translated into functional calls, which are then used to perform the business work flow.
I am not sure, if I was bale to answer your query.
1. When it is referred to class, its object oriented concept. Functions are traditional programming concepts. Class contains different methods which are of similar type. Object oriented structure provides more robust programming techniques such as inheritance, polymorphism etc compared to traditional programming.When you use class you need to create an object to call any method inside that class. It could be considered as it's more readable compared to traditional programming.
2. Keyword driven architecture is a frame work where keywords of application are stored in one place, accessed them when writing testscript.
Below is the code to demo Function and class that has similar functionality, store it in .vbs file and check.
Call ShowMessageBox ' Calls the function
Set obj=New MessageBox 'Creating object
obj.ShowMessageBox 'Calling the Function
' Function to show the messagebox
MsgBox "From Function"
' Class that has function to show the messagebox
MsgBox "From Function In Class"
You can try them in google to find more information.