Forum Discussion

SuperTester's avatar
SuperTester
Contributor
6 years ago
Solved

Input Parameter Error

Hello!

 

What does the error message "Cannot get a picture object from the input parameter" mean?

 

I have a comparison command that takes a picture from a region of a PDF file to be used as a Checkpoint. I keep getting the same error message. I checked and made sure with object spy that the object mapping is correct. So I think there are issues with my input parameters.

 

Comparison command:

Regions.NOCHANGES.Check(Regions.CreateRegionInfo(Aliases.Acrobat.wndAcrobatSDIWindow.AVFlipContainerView.AVDocumentMainView.AVFlipContainerView.AVSplitterView.AVSplitationPageView.AVSplitterView.AVScrolledPageView.AVScrollView.AVPageView, 182, 447, 547, 233, false), false, false, 0, 8);

 

Thank you!

  • It seems to be working now - I'm not sure why. I believe it was some kind of mapping issue.

     

    This is what I did:

    • I put break points leading up to the "NOCHANGES" command
    • When playback reached the breakpoint, I changed the view settings in the PDF viewer (scaled the view to 100%)
    • The NOCHANGEs line did capture the region and prompted me to update the region capture image
    • This lead me to believe that maybe the settings in the PDF reader had been changed at some point in time or it was updated.
    • I attempted to repeat the process of chaning the view zoom, however the "input parameter failed" error message returned.
    • I stopped trying to change the view zoom and now the checkpoint passes - with warnings:

      "There are several objects that match the identification attributes of the "AVDocumentMainView" mapped object"

    I'm very confused on why it works now.

4 Replies

  • Lagencie's avatar
    Lagencie
    Frequent Contributor

    Might be possible, that there are still elements loading, while you try this.

     

    So adding some dynamic wait until successful load might help. (or if there is no way to make it dynamic a fixed time where you are certain that loading will be finished - which makes tests slower, tho)

     

    if the answer helped, please consider giving kudos

    • tristaanogre's avatar
      tristaanogre
      Esteemed Contributor

      I'm with Lagencie  on this.  You're doing a CreateRegionInfo of an Aliased object but you need to make sure that the object exists before you attempt that.  The error message you're reporting seems to indicate that a region is attempted but no region exists.  Try adding a hard-coded delay before this call to make sure.  If that corrects it, considering adding a check with WaitAliasChild before your call to wait for the object to exist before proceeding.

  • It seems to be working now - I'm not sure why. I believe it was some kind of mapping issue.

     

    This is what I did:

    • I put break points leading up to the "NOCHANGES" command
    • When playback reached the breakpoint, I changed the view settings in the PDF viewer (scaled the view to 100%)
    • The NOCHANGEs line did capture the region and prompted me to update the region capture image
    • This lead me to believe that maybe the settings in the PDF reader had been changed at some point in time or it was updated.
    • I attempted to repeat the process of chaning the view zoom, however the "input parameter failed" error message returned.
    • I stopped trying to change the view zoom and now the checkpoint passes - with warnings:

      "There are several objects that match the identification attributes of the "AVDocumentMainView" mapped object"

    I'm very confused on why it works now.

    • tristaanogre's avatar
      tristaanogre
      Esteemed Contributor

      Honestly, that's classic timing issue problems.  Sometimes it works, sometimes it doesn't... and it comes down to, really, making sure that you tell TestComplete to be "smart" about waiting for components to show up before you try to interact with them.

      So, there are a number of things you can do to make sure that this continues to work well

      1) Make sure your mapping is robust enough to properly identify the component.  The warning message you mention seems to imply that you don't have a distinct enough set of mapping criteria to individually identify the component.  Take the time to research this.
      2) Make sure that your automation machines are running like a "clean room".  Configurations are locked down, applications/browser updates are strictly controlled, etc.  Test Automation, regardless of what tool you use, is dependant upon consistent environments.  If the environment changes, then the automation may break for mysterious reasons.

      3) Add timing waits.  There's a topic specificall about that in the help documentation, waiting for objects to exist.  Go read that and look at the techniques presented and apply them in your situation.