Forum Discussion

kara's avatar
kara
Occasional Contributor
12 years ago

Unable to obtain the item's rectangle.

I have recorded a keyword test where I click a radio button. The first time I click it, it doesn't hold the click, so I click it twice in the test. It was working fine, but now, the first time I click the button it works, and the second time I click it, the test stops and the error message is "Unable to obtain the item's rectangle." Since I copied the first line and pasted it in the code, for the second line, they are exactly the same. Why would the first one work, but not the second one.



Also, after remapping the button, it occasionally starts working, but then something else will stop - sometimes a dropdown list, other times a textbox. I have run the test all the way through a few times today and everything worked.



It will work 1 time, then I have to remap everything again. It's just randomly breaking. The code has not changed today. So, if it works once, it should work everytime.



Can anybody help?

9 Replies

  • kara's avatar
    kara
    Occasional Contributor
    I have actually found that if I put a delay of 2 seconds before the item that fails, testcomplete will find it. I don't know why that helps, because there is no postback or callback in the code, so it doesn't really make sense, but it does help.
  • It seems that either your tested application is changing (properties used to find tested object have new values) or your test is working in changing conditions. When you will face the error again try to find its cause. Here is the help article: Handling Playback Errors.
  • kara's avatar
    kara
    Occasional Contributor
    I don't think that's the problem. If I click on the radio button and select highlight on screen, it does find it. It just can't find it during the test.
  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Kara,


     


    Based on your description, I guess that some unreliable properties are used to map the button. This can explain why the first execution after remapping always passes. Please check what mapping criteria are used in your project for this object.


     

  • Any update on this?

    I'm also facing the exactly same problem.

    It make our automated workflow cannot run successfully from end to end. :(



    **Our name mapping is static

    Thanks.
  • Hi Tanya,



    Sorry for late reply.

    I did tried but the problem still occur intermittently.

    fyi, im using data driven loop for the execution. 

    the first loop will not given me problem, it would happen in 3rd or 4th of the looping.



    According your link



    The object does not exist > The object is exists as it is successful execution



    Unable to find the object object_name > never get this error before



    Cannot obtain the window with the window class class_name, window caption window_caption and index n > never get this error before



    About the 'Ambiguous Recognition of the Tested Object' message

    >
     yes, we get this but solve it after do some housekeeping of our name mapping file



    About the 'Mapped item has the Extended Find attribute enabled' message > never get this error before



    The mapped items was not found in the project > never get this error before





  • Hi Kara,



    Thanks for your sharing.

    I would like to try it out.



    but for my case, it happen anywhere and we cant really capture it consistently. Thus, it will not make sense with there are lots of "delay" in my execution.



    Hope smartBear team can give me some solution on  it
  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Simon,


     


    Some complex action may take place in your app while TestComplete is trying to obtain the object. This may explain why using the Delay method helps you.


    You can use WaitNNN methods that help you avoid this situation.