Forum Discussion

Leahy's avatar
Leahy
Contributor
5 years ago

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

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

14 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    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.

    • Leahy's avatar
      Leahy
      Contributor

      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?

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

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

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    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.