Forum Discussion

sarya's avatar
sarya
Frequent Contributor
15 years ago

Expanding web folders

Hi,



I have some sub-folders under  the main folder that I need to expand one by one by clicking on the box with +/- sign.

The recorded script comes like this but these IDs are subject to change at anytime. Is there a way to associate the corresponding expand folder sign with the foldername.For example - The expand folder icon corresponding to 'Accounting' folder that it recognizes the foldername and click on the icon adjacent to it.



var iexplore;


var all;


iexplore = Sys.Process("iexplore");


iexplore.ToURL("http://vmsa:8080/r2w/home.do");


all = iexplore.Page("http://vmsa:8080/r2w/home.do").document.frames.ifmfolder.document.all;


all.IF5848.Click(5, 10);


all.IF5849.Click(4, 9);


all.IF5850.Click(4, 7);


all.IF5851.Click(6, 8);


all.AF5852.Click();



Thanks,

Sumedha

5 Replies

  • Hi,



    Map your object names by their text and tag names (the innerText and tagName properties). See the "Name Mapping" help topic for details.
  • sarya's avatar
    sarya
    Frequent Contributor
    Hi,



    All the folder expanding icons have the same properties except their IDs,idStr,Name .e.g IF10,IF11 bur how can we create in script to click a particular sign for a particular folder.Can it be associated with folder name ?  NativeWebObject would not work as the outerHTML is same as the Name and the names are subject to change when I delete or add folders.



    Thanks.

    sumedha
  • Hi,



    This depends on the way objects on your page are organized. I recommend that you inspect the object tree in the Object Browser and check how expanding icons can be obtained by labels.
  • sarya's avatar
    sarya
    Frequent Contributor
    Hi,



    idStr = IF41 and namePropStr = plus.gif.



    For all the icons , namePropStr is same as plus.gif. Only the idStr changes as IF41,IF42 and so on. If I try to this in script :

    b = page.NativeWebObject.Find("innerHTML","demo");   // Recognize the folder


    c = b.parent.FindChild("namePropStr","plus.gif");  //Trying to click expand folder icon corresponding to the demo folder.



    But it clicks on some other icon for some other folder "SmartFolders".



    Why is it not recognising the plus sign adjacent to the mentioned folder.



    Thanks,

    Sumedha



  • Hi,



    Try using the icon position to recognize the correct icon. For example, use the Top property of the corresponding folder to do this.