Forum Discussion
Pavel_1
15 years agoContributor
Hi,
As I said they may differ by several pixels, and can be not exactly on the same level. That's why I supposed that your icon's "Top" property differs from the necessary folder's "Top" property not more than by 5 pixels. Check this in your object browser, it may appear to be that its just one pixel.
What exactly you did not understand in the code? I added some comments below
//obtaining your "demo" folder
a = page.NAtiveWebObject.Find("outerText","demo");
//getting all plus.gif icons under "demo" folder's parent object, the result will be array of objects
icons = a.parent.FindAll("namePropStr","plus.gif", 1);
//converting this array to JScript array
icons = VBArray(icons).toArray();
//iterating through all array elements
for (var i=0; i<icons.length; i++)
{
// checking each element, if its Top value equal to "demo" folder's Top value +-5 pixels then its the icon you need
if ((icons.Top>a.Top-5)&&(icons.Top<a.Top+5))
{icon = icons; break}
}
icon.Click();
Related Content
Recent Discussions
- 3 days ago
- 3 days ago
- 3 days ago
- 4 days ago