Unable to idetify message box using object spy
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Unable to idetify message box using object spy
Hi, I am trying to identify a message box using object spy; but it is unable to identify the message box. Below mentioned are the methods which are not present due to which it is unable to identify the message box: ,System.Windows.Forms.MessageBoxOptions.ServiceNotification | System.Windows.Forms.MessageBoxOptions.DefaultDesktopOnly System.Windows.Forms.MessageBox.Show("Hi TestComplete...", "Test Complete", MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1 ,System.Windows.Forms.MessageBoxOptions.ServiceNotification | System.Windows.Forms.MessageBoxOptions.DefaultDesktopOnly); Also please find attached screenshots for the same.
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Based upon the screenshots, it looks like the message is being served up inside some other component rather than as a message box by itself. What does that larger container resolve as in Object Spy?
Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----
Why automate? I do automated testing because there's only so much a human being can do and remain healthy. Sleep is a requirement. So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.
Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The class name of outer object is Infragistics.Windows.DockManager.DocumentContentHost and it can be easily identified.
Regarding the message box it is apparing as a separate window and so it is not identified.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It seems information window is been treated as another exe as we have seperate windows in the taskbar.
Try to change settings in process filter to use all processes
1. Open Current Project properties
2. Select OpenApplication--->Process Filter
3. Select use all processess from the dropdown.
Hopefully this will solve your problem of object spy in information window.
Please consider giving this a kudos if its helps to solve your problem.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Tried changing settings in process filter but still it is not working.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@apurvak wrote:
The class name of outer object is Infragistics.Windows.DockManager.DocumentContentHost and it can be easily identified.
Regarding the message box it is apparing as a separate window and so it is not identified.
So, the outer object is a content host. My guess is that the error message is coming from whatever is doing the hosting. This is why you can't spy the message box because it's not actually part of your application but being hosted in. You're going to have to use some sort of OCR or image based identification to find and interact with the object.
Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----
Why automate? I do automated testing because there's only so much a human being can do and remain healthy. Sleep is a requirement. So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.
Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks everybody for the help!
@apurvak, have you found the solution? Please share it with us.
Tanya Yatskovskaya
SmartBear Community and Education Manager
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am still not able to identify the object.
I am sharing two sample applications where in one application messagebox can be identied by Test complete and in another application messagebox cannot be identified.
Attached are the sample applications which are developed by our development team.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@apurvak:
Hi,
I think that you need to talk to developers and ask them how they open descendant window for the second application.
On my machine, main application window becomes not responsive after the OK button is clicked and remains unresponsive until this spawned window is closed.
(My guess, is that the window is opened within the .Click() button handler and thus the whole UI of the application is blocked until the child window is closed. If this is the case, consider the Runner.CallObjectMethodAsync() method described here: https://support.smartbear.com/testcomplete/docs/scripting/calling-methods-asynchrounously.html)
[Update]:
I decompiled both your applications using Telerik's Just Decompile and noted that:
a) Message box is opened indeed from the button's click() event handler. So you definitely will need to click this button asynchronously as it was suggested above;
private void Button_Click(object sender, RoutedEventArgs e) { MessageBox.Show("Hi TestComplete...", "Test Complete", MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1, MessageBoxOptions.ServiceNotification | MessageBoxOptions.DefaultDesktopOnly); }
b) Message box in the WpfApplication_NotAbleToIdentify.exe is opened using additional MessageBoxOptions.ServiceNotification | MessageBoxOptions.DefaultDesktopOnly flags (see code above) introduced for later versions of Windows. You may read more about them for example here: https://stackoverflow.com/questions/14280640/service-with-the-servicenotification-option, https://docs.microsoft.com/en-gb/dotnet/api/system.windows.forms.messageboxoptions?view=netframework... and https://docs.microsoft.com/en-us/previous-versions/bb756986(v=msdn.10)?redirectedfrom=MSDN.
Considering the above articles, I think that you need to talk with your developers and ask if these flags are really required? What will happen if no user is logged-in while the message is displayed? Won't this deadlock the application?
In case these flags are required indeed, I think that you need to contact Support directly via this form (https://support.smartbear.com/message/?prod=TestComplete) and ask for their recommendations. The case is that according to what I read in the above articles and saw in TestComplete's Object Browser, the whole UI of your application is locked and invalidated while the message box window is present on the screen. (TestComplete's UI is also frosen if the Object Browser is opened.)
/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
Thanks for the update, Alex.
@apurvak, does this reply help?
Tanya Yatskovskaya
SmartBear Community and Education Manager
