Micro Focus QTP (UFT) Forums

Full Version: Simple problem-unable to trace a button on form
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hi guys,

I'm beginner to QTP and in the learning process. I'm having a problem on testing an application.

It is very simple. I created an application with a form and add a button(in vb). The button's purpose is just to close the application. The button's name is buttonExit.

I'm able to learn(Object Repository Manager) the application to obtain the objects available in the form. Then i created a very simple script to run the application and close it, as below:

Code:
Window("Form1").Activate
wait(10)
Window("Form1").WinObject("Exit").Click

I guess the script was not wrong.

Error message upon executing the last code:

"Cannot identify the object "Exit" (of class WinObject"). Verify that this object's properties match an object currently displayed in your apllication"

Do you guys have any idea?

Thanks.
Hi,
U should be careful while learning the objects.
1)Did ur OR learn the Object with option all objects present in the window.
2)if this does not solve ur problem try to learn the object again.
Code:
if  dialog("abc").winbutton("xyz").exist then
msgbox "yes"
else
msgbox "no"
end if
this should resolve ur issue
regards,
Amit
9773539313