Forum Discussion

morde's avatar
morde
Contributor
11 years ago

Unable to obtain the object's rectangle

Hi everyone.



I am facing a problem with a textNode object. 

I have a function that runs in a loop (7 times maximum) and clicks this object - until it is no longer visible.



But... somtimes I get an error " Unable to obtain the object's rectangle" - althogh the object was clicked successfully. it rarely happens but it affects my tests. 



Is there a way to supress the error?



Thanks?



Mor.

5 Replies

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Mor,


     


    How are you obtaining the object? Try using the Wait methods for this. Also, it may help if you call the Refresh method of the object before clicking it.


     

  • maximojo's avatar
    maximojo
    Frequent Contributor
    I have this issue too. It is someone rare but obviously causes spurrious issues.
  • Hi Tanya, Thank you for your answer.



    The refreshMappingInfo (is this what you ment?) takes a lot of time and since I am using this function a lot during the test - I can't afford that. 
  • maximojo's avatar
    maximojo
    Frequent Contributor
    I am using a straightfoward



    obj.Click()



    and get the rectangle message. It's very random and I assume TC would wait the default timeout (10 secs) before you would see this message. However the object seems to be loaded (at least visually when I see the error image).
  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi,


     


    I've heard about a similar issue from our Support Team. Unfortunately, it's very difficult to investigate the behavior by our R&D team as it's reproduced randomly.


    If you are using Name Mapping to access objects, they recommend that you use additional mapping criteria - Visible=True and VisibleOnScreen=True.


    Otherwise, using the "Wait*" methods from script should help avoid this error: WaitItem, WaitTextNode, WaitLink, etc.