Forum Discussion

scrier's avatar
scrier
Contributor
14 years ago

Save a region to a folder deeper than 1 map.

Hi, 



I have some issues making Regions.Addpicture to work in several folders. I have the following folder structure:



Folder1

 Folder11

  Folder111



So Folder 111 is under Folder11 as well as Folder 11 is under Folder1



I want to add a picture under "\\Folder1\\Folder11" and doing this with javascript I do the following call:



Regions.AddPicture(picture, name, false, "\\Folder1\\Folder11");



This will add the picture with the name name under Folder1. Is this a known issue that you cant add it several folders down from Regions?



// Andreas

7 Replies


  • Hi,



    We tried to reproduce the behavior but failed. Which TestComplete version are you using? Please check whether the issue can be reproduced with TestComplete 8.50.







  • Version is 8.50.618.7 and trying today I can not get it to go to the "virtual" Folder1 even. I however noticed that they occur on the disk folder. Is there some way to store it to the virtual folder so the structure looks like before in the testcomplete project but it's physical under the <project>Stores/Regions/ folder?
  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    Hang on a sec...  Take a look at the screen shot attached.  Is that what you mean by wanting to add, via script, regions to different folders?



    If so, I'm not sure there is a way to do that in scripts.  The directory parameter of Regions.AddPicture does not relate to those folders but to the drive/directory/folder structures on the hard disk.  I cannot find anything in the documentation that describes how to do that.  


  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    Yeah.  As far as I can tell, the folders on the Project Explorer tree are visual display organization only.  There really isn't any referencing to them within script code.  



    For example, I can organize script units into multiple nested folders but, if I want to reference a unit for inclusion in another, all I need is the unit name.  The folder itself plays no part in identifying the unit of code, it is simply for organization.



    Is there a particular goal you have in organizing your regions in folders and such?  Perhaps there's some way that it can be handled in code without relying on folders.
  • More of a setup for now. Sadly we have built QT 4.6.4 with GCC which is not supported so for now we need to use screenshots to rely on our tests. And ofcourse there was a change in the latest release that made all the screencomparisons obsoloete. So I try to do a setup function for new versions that compares the old piture and see if it's still viable for identifying known states. Problem is that we have them organised in the visual folders and have to move them afterwards if they are replaced.

  • Hi,



    As an alternative, you can add the name of the logical folder to the image name and modify the second parameter of AddPicture.



    Also, we have the following suggestions in our database:

    - to make logical folder structure correspond to the physical folder structure on HDD;

    - to make it possible to save images to a logical folder in Stores | Regions.



    Your request has increased their rating. Thank you.