Forum Discussion

shivashish's avatar
shivashish
Occasional Contributor
13 years ago

Question about Referencing


Hi,


 I am planning to create an Automation Framework
with excel where the user will enter the data for creating the test cases. Then
i will have a script developed in TestComplete, which will read these steps and
create an Automated script(in VB). I will be creating two files, one file(File
1) which will contain the steps of the test case and another file(File 2) which
will contain all the common functions.


 a)      Now
I want the user to see only File 1 and File 2 should be referenced from file 1.
Is there a functionality in TC by which I can create a reference library and
Keep File 2 there? My whole purpose is the user will find it easy to decode code
of File 1 and the complex code of File 2 should be kept away from the user. Is
there a way to achieve this?


 b)      Also,as
part of my execution i read a lot of values from the screen and use them later
on during the execution. What would you recommend for storing these values at
runtime? Should I store these values as project variables or should I store them
in excel and retrieving it(as and when required)?


I tried finding the answer to these questions on the forum , but i was not able to find the answer and hence this post


Thanks,


Shiv

3 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    I'm not entirely sure what you mean by your "file 2" which contains all the common functions?  Typically, a framework structure based upon a data driven set of tables does not include code in the the files being used.  The files (in your case file 1 and file 2) are simply the data used to drive the test.  Code, including common functions, are written as either script functions in units in TC or as keyword tests.  A framework of script code is then created to read those files and, depending upon what is found, execute the specific code.



    An example of something that I created for this purpose can be found at 



    http://blog.smartbear.com/post/11-07-11/automation-framework---a-new-table-driven-technique-using-testcomplete/
  • shivashish's avatar
    shivashish
    Occasional Contributor
    Hi Robert,



    sorry for the delay in getting back , but i was on leave for the past two days.



    Actually, i have a file which consists of code. For ecample, it contains the function "EnterText". In file 1 i have 10 lines corresponding to the ten different steps in the test case. One of the lines looks like below



    call EnterText("Var1","var2","var3")



    so, when the user runs File1 in TC as a script function, the functions(which are in file 2) will be called in the proper sequence.



    the reason, i want to follow this structure is , i dont want the user to see the complicated functions in file 2(like "EnterText" and other similar functions). the user will jusrt see the steps like shown above(call EnterText("Var1","var2","var3")) and this will make life easier for the end user



    is there any way of achieving this?



    hoppefully, the question is clear to you



    Thanks,

    Shiv