You can do it in the same way.

Only instead
RunAction "Action_Name_1", oneIteration, "No"
you will have
RC = FunctionName1(...)
RC = FunctionName2(...)

You can use dtGlobalSheet, but also you can create your own spreadsheet and
call it by name
Datatable(“Column_Name”, "MyTDtable")

> If Datatable(“Column_Name”, dtGlobalSheet) = “Something” Then

You can use Select statement in order to create your one "key-words"

Function gDriver_RunAction(ActionName)

    Dim RC
    Select Case  Trim(ActionName)
        Case "LoadEnvironment"       RC = gDriver_LoadEnvironment(...)
        Case "ReloadAutomationDB"    RC =
gDB_ReloadAutomationDB(Environment("DB_NAME"), Environment("DB_HOST"))
        Case "TestCaseRunner"        RC = gDriver_Runner(...)
        Case "LoginDesktop"          RC = Desktop_Login(...)



On Fri, Jun 26, 2009 at 11:35 AM, johnthenu <[email protected]> wrote:



> Hi Roman,
> Thanks for taking time to explain very clearly.....many thanks
>
> I have a another question….
>
> My main Driver scripts reads something like this
>
> If Datatable(“Column_Name”, dtGlobalSheet) = “Something” Then
> RunAction "Action_Name_1", oneIteration, "No"
> RunAction "Action_Name_2", oneIteration, "No"
>
> ElseIf Datatable(“Column_Name”, dtGlobalSheet) = “SomethingOtherThing”
> Then
> RunAction "Action_Name_3", oneIteration, "No"
> RunAction "Action_Name_1", oneIteration, "No"
>
> -------------------------------------------------------------------
>
> Within the Action…..
>
> If Parameter("Validation")="Yes" Then
>
> Run this Script (Current Live System)
>
> ElseIf Parameter("Validation")="No" Then
>
> Run this Script (New system with same screen flow but different
> properties)
>
> End If
>
> -------------------------------------
> So If I use Function how can I split my function into 2…..like I have
> done in action using parameter (validation)
>
> Many Thanks
>
>
>
>
> On 24 June, 15:04, Roman Zilber <[email protected]> wrote:
> > Hi,
> >
> > Function:
> >
> > Easier to maintain 15 functions, than 15 actions :
> > You can choose nice location (ex. folder named lib/)
> > You can split functions to number of vbs files with meaningful name
> > example:
> > App_Login(name, password)
> > App_Logout()
> > App_LoginTest(name)
> >
> > in file APP_Login.vbs
> > Easy to maintain source control, only text files need to be saved (have
> to
> > be unicode format)
> > Easier to manage code (diff between text files, and diff between Action
> > folders)
> > Easier to share code between projects
> > QTP doesn't create extra runtime datasheet each time you call a function
> (it
> > make me crazy when I work with Actions)
> > You can open many functions at the time
> > ...
> >
> > Actions:
> >
> > Build in connection to Data table (in function you need to specify data
> > table name)
> > You can record directly in Action (can't in functions)
> > Big minus - you don't see Actions name, if a Test with the actions is not
> > open.
> >
> > Roman
> >
> > Clear interface - you see function name and function parameters
> >
> > On Wed, Jun 24, 2009 at 4:47 AM, johnthenu <[email protected]> wrote:
> >
> > > Hi, I have a customer form filling script with 15 pages......i am
> > > using DP for all the objects....except for page name and browser
> > > name......
> >
> > > Each customer will see different combination of pages depending on
> > > requirement which will be defined from the drive script.....
> >
> > > In this scenario should i make each of the page a action or a
> > > function....and what are the benefits making them as a function as
> > > apposed to action....
> >
> > > Many Thanks....
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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