How to avoid the log message "Unable to find the object 'xxx' "
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2010
02:37 AM
04-06-2010
02:37 AM
How to avoid the log message "Unable to find the object 'xxx' "
Hi
I am trying to find an object existance on the page using this below code.
I am trying to find an object existance on the page using this below code.
If DialogBoxObject.btnOK.Exists = True Then
.... ..
End If
But Testcomplete logs an error message "Unable to Find the object btnOK"
This is a log message logged by TestComplete and it points to the statement -DialogBoxObject.btnOK.Exists
I am not sure if it is related to TestComplete settings as i have noticed the same piece of code being used in other script does not log this message as error.
Anyone let me know how to avoid this to be logged as an error message.?
-Thanks
Sowmya BS
6 REPLIES 6
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2010
07:32 AM
04-06-2010
07:32 AM
Hi Sowmya,
It looks like you are using NameMapping in this test project.
If this is the case, you should use WaitNamedChild function to avoid error in the log if the sought for object ws not found.
E.g.:
If (DialogBoxObject.WaitNamedChild("btnOK", 10000).Exists) Then
' button was found
End If
See "WaitNamedChild Method" help topic for more details.
It looks like you are using NameMapping in this test project.
If this is the case, you should use WaitNamedChild function to avoid error in the log if the sought for object ws not found.
E.g.:
If (DialogBoxObject.WaitNamedChild("btnOK", 10000).Exists) Then
' button was found
End If
See "WaitNamedChild Method" help topic for more details.
Regards,
/Alex [Community Champion]
____
[Community Champions] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Champions]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
https://community.smartbear.com/t5/Community-Champions/About-the-Community-Champions-Program/gpm-p/252662
================================
/Alex [Community Champion]
____
[Community Champions] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Champions]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
https://community.smartbear.com/t5/Community-Champions/About-the-Community-Champions-Program/gpm-p/252662
================================
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2010
07:16 AM
04-08-2010
07:16 AM
This code worked fine when the 'btnOK' was found on the page. It did not log any error message in the log file.
But when the 'btnOK' is existing it fails to identify it and the script fails there.
I have the 'btnOK' in the namemapping.
Here is the below code
If (DialogBoxObject.btnOK.Exists) Then
(this above line is replaced with - If (DialogBoxObject.WaitNamedChild("btnOK", 10000).Exists) Then
DialogBoxObject.btnOK.Click()
Else
DialogBoxObject.btnYes.Click()
End If
but this new line makes the script wait for btnOK, it does not find it even the object exists.
Where am i going wrong?
But when the 'btnOK' is existing it fails to identify it and the script fails there.
I have the 'btnOK' in the namemapping.
Here is the below code
If (DialogBoxObject.btnOK.Exists) Then
(this above line is replaced with - If (DialogBoxObject.WaitNamedChild("btnOK", 10000).Exists) Then
DialogBoxObject.btnOK.Click()
Else
DialogBoxObject.btnYes.Click()
End If
but this new line makes the script wait for btnOK, it does not find it even the object exists.
Where am i going wrong?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2010
06:04 PM
04-08-2010
06:04 PM
Hi Sowmya
I have same kind of problem which you have.I have been working on it for the past few days. Please tell me if you found any solution for this problem.I will tell you if i found any solution for this
sai_siddhu451@yahoo.co.in
You can contact me here
Thanks in advance
I have same kind of problem which you have.I have been working on it for the past few days. Please tell me if you found any solution for this problem.I will tell you if i found any solution for this
sai_siddhu451@yahoo.co.in
You can contact me here
Thanks in advance
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2010
10:26 PM
04-08-2010
10:26 PM
Hi,
Check the recognition criteria in your Name Mapping scheme. Most probably, the button is mapped by properties which have unstable values. Also, try obtaining it with the WaitAliasChild method.
Check the recognition criteria in your Name Mapping scheme. Most probably, the button is mapped by properties which have unstable values. Also, try obtaining it with the WaitAliasChild method.
------
Yuri
TestComplete Customer Care Engineer
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Yuri
TestComplete Customer Care Engineer
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2010
03:38 AM
04-16-2010
03:38 AM
the dumb workaround i use for this kind of issue is log.enabled = false before the obj.exists and log.enabled = true after.
I tried all possible workarounds like waitwpf object etc. But when i try to look if it exists or not, I get error logs. So i use this for the timebeing..
Please post the result if you find any...
I tried all possible workarounds like waitwpf object etc. But when i try to look if it exists or not, I get error logs. So i use this for the timebeing..
Please post the result if you find any...
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2010
10:55 PM
04-18-2010
10:55 PM
Hi All,
This error in the log is caused by the fact that TestComplete cannot find an object by the mapping criteria specified in the Name Mapping tree. It is possible that the actual object that is not found is a parent object of the needed object. The exact object which is not found is specified in the 'Missing Object' section of the message posted to the Remarks pane along with the original error. You need to find this 'missing' object in the Name Mapping tree and make sure that it is mapped by properties that provide reliable and unique identification of the problematic object.
If you cannot find out what's wrong with your Name Mapping scheme, please contact us via the Contact Support form and send us your project suite along with the log of the failed execution.
------
Yuri
TestComplete Customer Care Engineer
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Yuri
TestComplete Customer Care Engineer
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
