Cannot get a picture object from the input parameter.
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Cannot get a picture object from the input parameter.
Hello,
I am having trouble I don't understand...I am using the "add a checkpoint via wizard" and choose "Image" and "Select window region"..
My code:
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.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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
Hi Robert,
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?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
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
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
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.
/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
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);
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
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);
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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
