I am having trouble I don't understand...I am using the "add a checkpoint via wizard" and choose "Image" and "Select window region"..
Success = Regions.Added_Columns2.Check(Regions.CreateRegionInfo(Aliases.hastus.Form.WIN_FORMTOOLSTRIPCONTAINER.WIN_FORMTOOLSTRIPCONTENTPANEL.Panel.dcsc03GlobalSplitter.Container.MainPanel.Panel.MainPanel_LayoutPanel.dcsc03Splitter.Container.GraphicPanel.Panel.GraphicPanel_LayoutPanel.ViewerCtrl.ViewerCtrl_impl.ViewerCtrl_impl_3.Container, 1, 1, 800, 27, false), false, false, 1440, 17);
The PNG is in regions, ( I re-did this again this morning...), but I still get this error...
"Cannot get a picture object from the input parameter."
Solved! Go to Solution.
So, here's the deal. That object does not exist in your listing. However the error was pointing out that it was looking at Aliases.hastus.Form as where the problem is.... and your addtomap error is indicating that you already have the form you're looking for mapped to that item. So, there's your problem. It appears that your automation is looking for one name but you have it named something else entirely in your mapping. Not exactly sure how that happened but that seems to be the case. The status drop down that you're looking for is part of a chain of objects off of that Aliases.hastus.Form. So, it looks like you're going to need to edit those steps in your script to point to the proper object in your Aliases tree.
It's possible that the object does not exist at the time the code is called... a timing issue where there is a delay between when the object is generated and when the region checkpoint is called. To test this, drop a breakpoint on your Region check and make sure that the object is present.
I put a breakpoint at the Region checkpoint and the item I am testing IS on screen, I still get the same "Cannot get a picture object from the input parameter." error... 😞
Does this error mean testcomplete cannot get the picture from the tested app or cannot get the picture from regions?
I would suggest to put a breakpoint on the .Check() line and, when stopped, evaluate the sought for object in the Evaluate dialog.
If evaluation of the
expression returns the object, inspect it from Evaluate dialog and check that expected object was returned.
Also, from the Regions panel check that Added_Columns2 element has an associated image file in place.
It's that it can't get the picture from the application. The part that's Bold... if that final Container object does not have a "Picture" property, it cannot obtain a picture to be used for the check.
Regions.Added_Columns2.Check(Regions.CreateRegionInfo(Aliases.hastus.Form.WIN_FORMTOOLSTRIPCONTAINER.WIN_FORMTOOLSTRIPCONTENTPANEL.Panel.dcsc03GlobalSplitter.Container.MainPanel.Panel.MainPanel_LayoutPanel.dcsc03Splitter.Container.GraphicPanel.Panel.GraphicPanel_LayoutPanel.ViewerCtrl.ViewerCtrl_impl.ViewerCtrl_impl_3.Container, 1, 1, 800, 27, false), false, false, 1440, 17);
I just re-did the "Add checkpoint via wizard", again I chose Image BUT, instead of "Select window region" where I would draw a box, I chose the"Point and press the shorcut (SHift+Ctrl+A)" option.
This works...why ??? I dont see a difference in the code ?
Success = Regions.Added_Col.Check(Aliases.hastus.Form.WIN_FORMTOOLSTRIPCONTAINER.WIN_FORMTOOLSTRIPCONTENTPANEL.Panel.dcsc03GlobalSplitter.Container.MainPanel.Panel.MainPanel_LayoutPanel.dcsc03Splitter.Container.GraphicPanel.Panel.GraphicPanel_LayoutPanel.ViewerCtrl.ViewerCtrl_impl.ViewerCtrl_impl_3.Container.SplitterPanel.Panel.ViewerCtrl_impl_3_0_0_Panel.Panel.ViewerCtrl_impl_3_0_0.Panel.Header);
This does not work???
//Success = Regions.Added.Check(Aliases.hastus.Form.WIN_FORMTOOLSTRIPCONTAINER.WIN_FORMTOOLSTRIPCONTENTPANEL.Panel.dcsc03GlobalSplitter.Container.MainPanel.Panel.MainPanel_LayoutPanel.dcsc03Splitter.Container.GraphicPanel.Panel.GraphicPanel_LayoutPanel.ViewerCtrl.ViewerCtrl_impl.ViewerCtrl_impl_3.Container.SplitterPanel.Panel.ViewerCtrl_impl_3_0_0_Panel.Panel.ViewerCtrl_impl_3_0_0.Panel.Header);
The only difference I can see is in the region that you're using Added versus Added_Col. That means going back to Added_Col and make sure that there is an actual file there to compare to... that there is an image present.
I am very frustrated with this product. See attached picture. The error says it "Unable to find object", "A screen shot was taken". The screen shot is the object the error says testcomplete cannot find....
I am looking at alternative s/w.
Right. So, the object is there, that's certain. But there are a number of factors that go into identifying the object. So... let's start there.
1) Using the Object Spy (https://support.smartbear.com/testcomplete/docs/testing-with/exploring-apps/object-spy/about.html) highlight the object and get the list of properties and their values. There is an "Advanced" link that will show the full range. Screenshot whatever is there and post those screenshots.
2) Your log entry for the error has a "Details" tab that gives a lot more information about the Not Found error. It could be that the object itself is just fine but something in the hierarchy of mapped objects (a parent object or something) may not be found. Please get us those details.
3) Finally, NameMapping: The object is mapped, the error indicates that by the naming. So, that means we can compare the list of properties and their values as they are mapped to the properties you obtained in #1 above. Because while the object MAY be visible and present, the properties you are using to FIND the object may have dynamic factors in them that need to be accounted for. Find the object in your NameMapping and screenshot the properties and their values that you are using for identification. It would be helpful to see the full hierarchy tree so we can also start examining the parent objects.
Bonus: Timing.... it's all about timing. You may have the automation running too fast. As a debug test, put a "Delay" of, oh, 5000 ms before the point that the error occurs. Also... in your screenshot? There's another error ABOVE that one... what's that error? Errors cascade you know... if something goes wrong early, it could impact the next steps in your automation. Might be nice to know what the other error is.