Micro Focus QTP (UFT) Forums
QTP "Cannot identify the object" - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: QTP "Cannot identify the object" (/Thread-QTP-Cannot-identify-the-object)



QTP "Cannot identify the object" - richardpaulhall_2 - 10-28-2008

First off, I have been using QTP for only two months so bear with me.

I have been tasked to learn QTP and support a suite of "record and play" test scripts.

These screen gadgets are static. The 'content' of the screen gadgets is dynamic, but new gadgets do not appear and none disappear.

I have an issue where the test causes a new browser window to pop up. Dozens of other scripts in the suite bring up a new window and QTP and those scripts have no problems. But this script has an issue.

Line (27):
Code:
"Browser("").Page("").WebList("Apply").Select("HHH")".

brings up this error:
"Cannot identify the object "Apply" (of class WebList). Verify that this object's properties match an object currently displayed in your application."

I am new at QTP, but I am an experienced programmer, tho not with VB.

"HHH" is an item in the list.

This is not a Sync issue, neither Browser("").Page("").Sync or Wait( ) helped. The web page has finished rendering.

I rebuilt the offending line and used the hints from the editor. The syntax is correct and the object names agree with the Local Repository.

I wrapped the misbehaving code with:
Code:
IF Browser("").Page("").Exist THEN
        Browser("").Page("").WebList("Apply").Select("HHH")
    END IF
and the same error was thrown. QTP sees the browser and page.

The "Highlight in the application" tool did highlight the web list in the application.

I rebuilt this page in the Local Repository and still got the error.

The "Update from Application" tool did not make the error go away.

But, the "Locate in Repository" tool said: "Cannot locate this object in the object repository."

So what do I not understand? The object is there. The page is visible and stable in the browser. The Repository agrees with the code. The Repository was built from the page, but the Repository does not recognize the gadget on web page.


I am using QTP 9.0. Upgrading to a supported, current, version is not an option.
The box is running windows XP and the browser is IE 7.0.5730.11

Rick


RE: QTP "Cannot identify the object" - rnickerson - 12-13-2008

I stay as far away from the object repositories as I can so I'm no real authority on them. That said, if I were faced with this problem I would try a different method of identifying the WebList object - Descriptive Programming. Using the Object Spy on it I would grab some properties and values to uniquely identify it such as "name", "html id", and maybe "class". Then you can use:

Code:
Browser("obj").Page("obj").WebList("name:=namevalue", "html id:=htmlidvalue", "class:=classvalue").Select("HHH")

The Browser and Page objects can be the items from your repository, but the WebList descriptive key/value pairs provide you with a measure of control over how to identify the WebList object directly in your code.


RE: QTP "Cannot identify the object" - balak89 - 08-05-2015

I'm also facing the similar issue. Even it through's error even in descriptive programming. It says the object is not present.
When i use object Repository. i'm able to "Highlight " the object from the Repository and its getting highlighted in application. But while running it through's error.

How to solve this error.


RE: QTP "Cannot identify the object" - ADITI1992 - 08-20-2015

if you are able to highlight in application then it means qtp is capturing the object.
look for the properties that are captured in OR and then use those properties in your descriptive programming for defining the objects