Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

QTP - Object Not Always Recognized

Status
Not open for further replies.

Medchill

IS-IT--Management
Mar 15, 2007
1
US
I am using QTP 9.0

When I execute the following, I get no errors, when I playback:
Browser("Browser").Page("Page_2").Frame("display").WebElement("WebTable").Click
Browser("Browser").Page("Page_2").Frame("display").WebButton("WebButton").Click
Browser("Browser").Page("Page_2").Frame("display_2").WebButton("Sender/Receiver").Click
Browser("Browser").Page("Page_2").Frame("footer").WebButton("Save").Click
... I enter the page, select another tab, then select [Save]

The same is true I execute the following, when I playback:
Browser("Browser").Page("Page_2").Frame("footer").WebButton("Save").Click
... I am already on the pass and select [Save]

However, when I execute the following, I get an error, when I playback:
Browser("Browser").Page("Page_2").Frame("display").WebElement("WebTable").Click
Browser("Browser").Page("Page_2").Frame("display").WebButton("WebButton").Click
Browser("Browser").Page("Page_2").Frame("footer").WebButton("Save").Click
... I enter the page, then select [Save]

Run Error
Cannot identify the object "Save" (of class WebButton). Verify that this object's properties match an object currently displayed in your application.
Line (52) "Browser("Browser").Page("Page_2").Frame("footer").WebButton("Save").Click"

Run Time Error : Save ..
Cannot identify the object "Save" (of class WebButton). Verify that this object's properties match an object currently displayed in your application.

Description : Save ...
Object's phyiscal description:
Visible = -1
Type = button
Name = Save
Mercury Class = WebButton
Html Tag = BUTTON
Html Id = DHTML Class = submitButton

... What can I do, so I don't have to slect another tab to [Save]. Also, QTP scripts work one day and not the next ... and there hasn't been any changes to the application.
 
Hard to say from the information given, but I'd hazard that the first WebButton Click on some way enables the Save button?

From your physical description - Visible is -1.

QTP Help states:
QTP Help said:
Indicates whether the object is visible.
Note: Only True and False are valid values for this property. 1 and 0 are not valid values.

This would suggest that the object isn't clearly defined?


Cheers,
Dave

"Yes, I'll stop finding bugs in the software - as soon as you stop writing bugs into the software." <-- Me

For all your testing needs: Forum1393
 
Hi Medchill,

I already faced such a problem. In fact, most of the time, clicking on a button in a user interface starts other processes in the background of the application.

You can bypass this inconvenience by one of these two ways:

- If you have a status bar in your application, put a checkpoint on it so that you can retrieve your initial state. For instance, this status bar can say "Ready" or any other message indicating its default state. After you click on the button, the checkpoint will wait until you retrieve your initial conditions.

- You can simply add wait states. Take a quit "sufficient" wait time. I usually use 3 seconds for my applications.

I hope this will be useful for you.

Kind regards,
GUIValid
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top