I am currently working with an HTML application which has a lot of elements on it, and doing so programatically. As such, the find() method is taking a long time to find objects because of how many elements it has to look at before finding the match. Is there some way to write my code so that it will find the objects more efficiently?
I generally search for an object across the entire web page. I thought that it might speed things up if, instead of trying to go directly for my target object starting from the browser test object, I first find a couple of parent objects of the target object. That way, it would stop searching once it finds the parent object, and then begin searching again from that point, getting closer and closer at every step, so as to "point it in the right direction" instead of having to look through the entire web page. However, this has given me mixed results. It has sometimes made my scripts faster, but it has also sometimes made it even slower.