cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot get a picture object from the input parameter.

SOLVED
Highlighted
Contributor

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."

1 ACCEPTED SOLUTION

Accepted Solutions
Community Hero

Re: Cannot get a picture object from the input parameter.

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.


Robert Martin
[Community Expert Group]
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
Extensions available
14 REPLIES 14
Community Hero

Re: Cannot get a picture object from the input parameter.

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
[Community Expert Group]
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
Extensions available
Contributor

Re: Cannot get a picture object from the input parameter.

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...  Smiley Sad

 

Does this error mean testcomplete cannot get the picture from the tested app or cannot get the picture from regions?

Community Hero

Re: Cannot get a picture object from the input parameter.

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.

 

Regards,
Alex
[Community Expert Group]
____
[Community Expert Group] members 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. Postings made by [Community Expert Group] members
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.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================
Community Hero

Re: Cannot get a picture object from the input parameter.

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
[Community Expert Group]
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
Extensions available
Contributor

Re: Cannot get a picture object from the input parameter.

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);

Community Hero

Re: Cannot get a picture object from the input parameter.

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
[Community Expert Group]
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
Extensions available
Contributor

Re: Cannot get a picture object from the input parameter.

I don't understand why it works now and not before, all files exist in both explorer and in the app regions..see attached jpgs...

Contributor

Re: Cannot get a picture object from the input parameter.

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....

 

Grrrrrr..

 

I am looking at alternative s/w.

 

Community Hero

Re: Cannot get a picture object from the input parameter.

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
[Community Expert Group]
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
Extensions available
New Here?
Join us and watch the welcome video:
SeptemberNews
Top Kudoed Authors
Join the September Hub-bub to show off, learn and win