Welcome, Guest. Please login or register.
Login with username, password and session length

 
Advanced search

18120 Posts in 4741 Topics- by 31743 Members - Latest Member: suuraj
 

Pages: [1]   Go Down
Print
0 Members and 1 Guest are viewing this topic.
Author Topic: FrameWorkManager    (Read 1095 times)
Pradeep Kumar
User
*
Offline Offline

Posts: 18


WWW
« on: November 24, 2007, 06:34:55 PM »

Hi,
I am new to this forum. I was recently assigned to research a opensource automation framework. My Intital plan was to use an opensource framework for keyword driven testing. I could not find any. I just came to know about frameworkmanager which now I plan to use for our web based applications (Java & .net)

I try to get the very basic knowledge about all libray classes and open the demo in QTP 9.2. I tried to run Example7 but I get an error everytime as :

"Expected: QTP Object Exists
Actual: Object doesn't exist
Details: Aborting Field Input
Field =Web Example_Browser_Page_Knowledge Base"

Am I missing anything ?

1) My understanding was : when I call this oRoot.GetLeaf("Web Example_Browser_Page_Knowledge Base")--this return an clsTreelevel then I was not sure why the "Input" function is required here to return a boolean.

oRoot.GetLeaf("Web Example_Browser_Page_Knowledge Base").Input("Knowledge Base>Env. Techniques>Web>Dynamic Java Trees>Example>Sub Example") 

2) When I spy the "Knowledgebase" link under www.advanceqtp.com I don't see any property value for "html id:=spge1" (DPID), it shows me blank.

3) When from the Excel it sees WebJavaTree as inputfile, it should use InputWebJavaTreeClass as mini class. What action it will invoke from this class  and where it is defined ?

4) What excalty type (here is "Field") is ?

5) I have read Understanding FrameworkManager.htm but could not quiet understand thw workflow. Am I missing anything ?

Thanks for your response
Logged
Site Administrator
Administrator
Active User
*****
Offline Offline

Posts: 56



WWW
« Reply #1 on: November 24, 2007, 09:01:23 PM »

Thanks for exploring FrameworkManager Smiley

For that example an internet explorer web browser must be opened to www.AdvancedQTP.com.

1. The input function returns a Boolean to allow for in-script decision making.
for example, if you're inputing a mandatory application field, and the .Input method returns False (i.e. the input action was not successful), you can catch that answer and react accordingly (e.g. quit the action, or report a critical error to the user).

2. The relevant link is in the side-bar tree (not the top-bar tree). I've just checked it, and its html id is indeed spge1.

3. The input mini-classes "just sit there", until you (the user) invoke the .Input action on the relevant clsTreeLevel object.
The input action involves a lot of small actions, among them are two actions which are invoked in the relevant mini-class:
.Input - This method actually performs the input action (in this case, navigating the tree)
.GetCurrentValue - This method is used to validate the status of the input action (true/false). It's more important in object which actually store the inputed value (such a textboxs, comboboxs etc.)

4. I didn't quite understood your question, sorry.

5. I guess that although I've tried, the help file is not very helpful Smiley
Do you mean the work flow with in FrameworkManager itself, or how does it fit into your scripts?
Logged

Yaron Assa

AdvancedQTP Site Administrator
Pradeep Kumar
User
*
Offline Offline

Posts: 18


WWW
« Reply #2 on: November 25, 2007, 06:55:30 PM »

Thanks for your reply. I can able to run Example7 now. Some of things I need to clear..............

1) For this particular Example7 when I say oRoot.GetLeaf("Web Example_Browser_Page_Knowledge Base")--It returns a clsTreeLevel leaf  like
"Knowledge Base>Env. Techniques>Web>Dynamic Java Trees>Example>Sub Example" is this right ? Now when I say
oRoot.GetLeaf("Web Example_Browser_Page_Knowledge Base").Input("Knowledge Base>Env. Techniques>Web>Dynamic Java Trees>Example>Sub Example")  it returns true since it finds the leaf level in the tree structure. Am I right ? for this example "Knowledge Base>Env. Techniques>Web>Dynamic Java Trees>Example>Sub Example" this is not a mandatory field?

2)You are right.

3) Here is my biggest confusion. When I run the script from QTP I was looking for the workflow of this particular Example7 within the framework.
So from the script I invoke
 
 Call oRoot.GetLeaf("Web Example_Browser_Page_Knowledge Base").Input("Knowledge Base>Env. Techniques>Web>Dynamic Java Trees>Example>Sub Example") 

My Question is what is the driver class that goes against the excel file. Is this clsTreeLevel class ?

The workflow I see is as follows :

a)  oRoot --create root object
b) GetLeaf--get Leaf of the provided path
c) .Input("Knowledge Base>Env. Techniques>Web>Dynamic Java Trees>Example>Sub Example") --returns true if the leaf is in the tree
d) How these call the mini class InputWebJavaTreeClass,  from clsTreeLevel class ? You mentioned: Input method on the relevant clsTreeLevel object
will call the mini class (I don't see this in the code) and also I could not understand how this call .Input action (in this case, navigating the tree) and
.GetCurrentValue from the InputWebJavaTreeClass
e) How these code takes the object identification string from the excel file ?



4) I meant "Field" in the "Type" column of excel file.

5) Only files I have read are in "Framework\FrameworkManager\FrameworkManager\Documentation". For "Help" files do you mean these files ?

Sorry that I am asking lot of questions. I took this Example7 and thaught If I understand this example I can start using this framework. My plan is to create
a login action which will take username and password and get into the application. Then I have my own custom function which will validate that page. I wanted to put this in Excel so the FrameWorkManager works. Do I have to understand all the library functions in order to use this framework?

Thanks for your patience and response.
Logged
Site Administrator
Administrator
Active User
*****
Offline Offline

Posts: 56



WWW
« Reply #3 on: November 26, 2007, 12:23:00 AM »

1. Let's separate the long command into two stages.
oRoot.GetLeaf("...").Input("...") is actually two commands:
oRoot.GetLeaf("Web Example_Browser_Page_Knowledge Base"), which returns the clsTreeLevel object corresponding with Web Example_Browser_Page_Knowledge Base (or Nothing if it can't find a corresponding clsTreeLevel).

After the object was returned, we execute its .Input method. This method will return the True/False result of the input action.

So if, for instance, the script wouldn't find the corresponding excel level, we wouldn't get "FALSE", but rather a script error, as we would've tried to execute a .Input method on a Nothing object (which has no methods).

To make it more clear, you can see this one long command as a shortcut for this code:
Code
GeSHi (qtp):
Set oRelevantTreeLevel = oRoot.GetLeaf("Web Example_Browser_Page_Knowledge Base")

bResult = oRelevantTreeLevel.Input("Knowledge Base>Env. Techniques>Web>Dynamic Java Trees>Example>Sub Example")



If bResult = True Then

  MsgBox("Input successful")

Else

  MsgBox("Input unsuccessful")

End If

 
Created by GeSHI 1.0.7.20

3. Yes, each excel level is translated into a clsTreeLevel object.
Your confusion begins with the job of the .Input command.
The command already assumes the clsTreeLevel object exists (it is activated from that object). It's job is to try and perform an input action on that level. If this level were a textbox, the action would've entered text into it.

The input command is very elaborate, and has many different stages. One of these stages, is to activate the mini-class connected to the clsTreeLevel object.
So when you execute oRoot.GetLeaf("...").Input("..."), one of the things that will happen is the activation of the .Input method in the InputWebJavaTreeClass.

Another thing that happens as part of the input action is the activation of the .GetCurrentValue in the InputWebJavaTreeClass.

As for the object identification string - Whenever the clsTreeLevel tries to manipulate its connected QTP object, it checks to see if that object is already initialized. If it's not initialized, it calls the LoadQTPObject method to initialized it. The LoadQTPObject uses the object identification string to build a DP QTP object.

4. Type is meant to be a kind of business logic marker of the excel level's "job" in the application. It has no "real" meaning, but it can be used to control certain things in your script.
For example, in my projects, I only report the input actions on objects whose Type property = "field" (as one fields may contain many different objects, and I don't want a separate report for each and every one of them). I sometime designate the save button of a window as type="Save", and then I can generically automate the save operation (as I never use the specific button's name, but rather search for a button with the type property = "save").

5. In the root of the FrameworkManager's folders there should be a .CHM file, with a lot of help sections, as well as complete code documentation. I would also recommend going through every example (not just 7), and maybe even using the debug mode to see exactly what gets called and when.

No problem, I thank you for investing the time to understand the framework and try to use it.

You don't need to understand all the ins-and-outs of the framework (e.g. how exactly is the QTP Object built for each level), but I would strongly recommend you'll know the JOB of each public method and property in the clsTreeLevel class (you can use the code documentation for that), the purpose of every column in the excel file, and track a .Input command via the debug mode from start to finish at least once.
Logged

Yaron Assa

AdvancedQTP Site Administrator
Pradeep Kumar
User
*
Offline Offline

Posts: 18


WWW
« Reply #4 on: November 27, 2007, 05:32:01 PM »

Thanks Yaron. I appriciate your detail response!!. I will try to understand the farmework and get back to you if I have any more questions. World is beautiful if someone like you extend their hands to help people.

Thanks
Logged
Site Administrator
Administrator
Active User
*****
Offline Offline

Posts: 56



WWW
« Reply #5 on: November 27, 2007, 08:58:00 PM »

Thank you very much Smiley

It's a pleasure to do so when you give such a strong feedback Smiley
Logged

Yaron Assa

AdvancedQTP Site Administrator
Pages: [1]   Go Up
Print
Jump to: