Forum Discussion

longchasen's avatar
longchasen
Contributor
6 years ago

Finding object getting slow

i have an extension which input data from a combo box and part of the routine is to find the dropdown object which only show on DOM after first dropdown, this is the snippet code:

 

pickerMenu = page.find("idStr",pickerMenuId,1);

 

as you can see i have define the depth to 1 as i know it will alwas shown on that depth. It run fast initially but after some time it getting slower from initial 0.2 to 17 seconds after 20 minutes. Im monitoring the CPU and memory usage and it shows below 100% most of the time. I made a routine to refresh the browser to remove some object on the DOM but it still persist, i need to make the performance consistent with same routine over long run. 

2 Replies

  • Vallalarasu_P's avatar
    Vallalarasu_P
    Frequent Contributor

    Change the parent from where you use find.

    Try using more properties. 2 or 3 to find unique

    Clear your cookies.

    Restart your machine

    Use Object.Refresh

    Object.Refreshinfo before perfoming operation on search

     

    Regards

    Valla

    • tristaanogre's avatar
      tristaanogre
      Esteemed Contributor

      Finding objects dynamically like that is intrinsically slower than using more direct object identification methods.  As mentioned, try expanding the properties being used to be more specific.  I'd even try doing a mapping of the object rather than having to search for it every time.