Forum Discussion

Anumakonda_mahe's avatar
Anumakonda_mahe
Frequent Contributor
11 years ago

Unable to obtain item's rectangle

Hi Smartbear Team,

 

I am getting this error “Unable to obtain item's rectangle” while Executing Keyword Tests. Pls. let me know the solution to solve this. I have created project with more than 40 tests and  all the tests are added to Project Items and executed the same. Then this message is displayed for few of the tests. So I have executed that test separately then it’s worked fine without any error.



Note:- This Error is displaying randomly for tests while executing Project items. Pls. let me know  the solution if you came across the same problem.



Web Application : . NET





Thank You,

10 Replies

  • I get this error intermittently too. Inserting delays seems to help, but then it just happens somewhere else in the keyword test! Please let me know if a solution is found.



    Thanks,  Jim
  • Anumakonda_mahe's avatar
    Anumakonda_mahe
    Frequent Contributor
    Hi,



    This problem is getting Most of the times at clicking buttons / selecting dropdown values. pls. let me know is there any settings to keep for the same. adding delay is not correct way.

    in older version it not there. Previous successfully executed scripts are now getting fail because of this issue.  Pls. let me know  if is there any solution.
  • pclarke's avatar
    pclarke
    Occasional Contributor
    I have also been getting this error. It only started after I upgraded to V9.30.3373.7

    I have been fixing it by checking if the object is visible/enabled - if it is not visible or enabled inserting a delay to wait for it to be visible/enabled. It is a messy fix so if there is a better way I would like to hear about it!



    .NET web page
  • Anumakonda_mahe's avatar
    Anumakonda_mahe
    Frequent Contributor
    Hi Smartbear Team,



    It is not there earlier. pls. let me know if there is any fix for the same. From few days we are facing this problem. it is very difficult to keep delays for each transaction in our project because it have more than 40 tests. it takes more time to execute test if we add delays.

    pls. let me know the solution for the same.

  • Hi Mahesh Anumakonda, i m having same issue but i m using delay method for time being.

    Please let me know once you get solution to this issue.



    many thanks,

    sam
  • If you have to use a Delay I would suggest using a Wait instead. Especially in cases where you have a lot of delays. The problem with delays is that they add so much time to your running script. A wait will only wait as long as it has to. So if you put a delay of 5 seconds it will always be a 5 second wait even if the object you want is available after 1 second. A wait will continue the test as soon as the object you want is available.



    // do some tasks then click on some object



    Delay(5000); // Delay for 5 seconds until we know object we want to click is ready

    Sys.Process("ProcessName").Object("ObjectName").Click();



    //Here is the better way to do this.

    Sys.Process("ProcessName").WaitObject("ObjectName",5000).Click();



    // Now if the object is ready say in 2 seconds instead of 5 it will click the object and move

    // on with your test.





    Of course I've still seen the "Unable to obtain item's rectangle" while using both delays and waits. Let us know when support gives you an answer on how to solve that one.

    If I figure it out before then I will let you know.

    So far my method of solving the problem is by using the magical Find method that comes with every object. The Find method is pretty much the answer to most problems.





    Thanks so much,



    Levi Bryant
  • I found the answer to my problem. I'm not sure if my fix will help anyone but it is worth a shot. It turns out that every time I was seeing this problem it was immediately following a search for the particular item that caused the problem. I found that when I ran a search in VisualStudio for a particular item, intermittently the search would cause TC to lose focus on the item it wanted to select. By removing search from my tests I was able to eliminate this problem. I imagine most of you are not even searching and still getting this issue. I think the point is not the search but rather something you are doing is intermittently taking focus and not giving it back. For me it was the search option in the application i'm testing. In my case delays and waits and finds did not cure my issue. I had to find out what item in my workflow was not letting go of focus and then removing that item from my workflow. I think the actual item causing the problem was a little popup tooltip that would list my previous search words in an attempt to help me autocomplete my search word. Sometimes that tooltip would disappear and allow my test to continue and other times it would remain and that caused the rectangle issue due to some focus problem. 
  • Anumakonda_mahe's avatar
    Anumakonda_mahe
    Frequent Contributor
    Hi Levi Bryant'



    Yes this problem is getting at Search option, i am getting this problem at selecting search option from dropdown and clicking  button / value listed. if we execute this step separately then it works fine