How to map Local Objects checkpoint under a common local object name - QTP 11.0
I have a web application for which we are doing automation and have below scenario to solve
For certain actions we need to capture local objects as these objects will be applicable for that action . We are following a modular framework where multiple actions are called in one parent action . I am trying to add my text checkpoints from this parent action
But for each page checkpoint , a new page object is captured . But I want to add these checkpoints under a common pagename name object . Is it possible ?
Like consider an eg : ebay.com
Where I have Homepage ,different category pages , payment page etc
In Home page my object hierarchy is Browser("Home").Page("Pagename").check checkpoint("")
when I come to category page , a new object is created for pagename like Browser("Home").Page(Pagename1").check checkpoint("")
But I want the name of the 'page name' object as same like home page . How can I do this ? Because in each page am going to capture the same text and only difference is the page which am visiting . Is it possible to map under a common pagename instead of getting added under different pagename object. I can copy these objects under shared object respository which I don't want to do this as these checkpoints are specific to one script and need to be local .
Like Browser("Home").Page("Pagename").Check checkpoint(")
Last edited by bineesh77; 06-21-2013 at 09:11 AM.
A checkpoint is reusable, not tied to a specific page. You can reuse the same checkpoint against any page.
If you are wanting to execute the checkpoint against any page, you can use descriptive programming. For example:
Alternatively, you can create a Page Test Object that has no identification properties and it should map to any page. If you named this Test Object "Generic Page" then you would keep reusing the following code:
Browser("Home").Page("Generic Page").Check checkpoint("")
Last edited by BrianJM; 06-21-2013 at 10:49 AM.
Thank You ! It worked .
I was curious where you store the checkpoint. Is it at the page level in the OR?
I am storing the objects in page level . I was thinking the the way brian was saying will work . But my issue is like this
- Have text checkpoint in each page and in each page the 'before' and 'after' part is different
- The objects are captured locally
- But each time when we add a new checkpoint the page name object is added as new and the checkpoint will be mapped under to this object ( like below)
Browser("Checkout").Page("Pagename - Fashion's_2").Check ( CheckPoint("ChkPoint_MSC_Dropship"))
- But I want to map the checkpoint to one pagename like below
Browser("Checkout").Page("checkout").Check ( CheckPoint("ChkPoint_MSC_Dropship"))
I tired to copy the checkpoint in Object repository and paste under checkout page object . I am able to copy but when I tried to run the scripts am getting error message "object doesn't found"
Can you please help out
For your concerns:
1. If you need to check different text, you need different checkpoint.
2. When creating Checkpoint, it will be stored in Local Object Repository, but you can move it to Shared Object Repository. In Object Repository Manager, open your Shared Object Repository, select Object>Update from Local (let me know if you haven't done it. There are a few more steps to make it work)
3. As I remember, Checkpoint is stored in a separate area than the Objects. And as Brian said, you can call the CP in any page, as long as the content of the checkpoint is relevant to the page.
By Changing the object name it's worked and thanks to all of you for the valuable suggestion