SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 3 of 3
  1. #1
    Apprentice
    Join Date
    May 2010
    Posts
    43
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    How to down load resources from QC ALM Test Resources to Local machine

    Hi,
    Along with environment file. object repository and library functions we also uploaded test data xls to Test Resources of QC ALM.

    The script is integrated with all the resources with out any issue. but for test data sheet we are not able to use Datatable.import<Quality Center\Resources>

    can anybody provide me the code for downloading the test data xls from QC ALM Test resources to local machine?

    and also the code for uploading the results and images in a zip folder to QC ALM test Results folder.

    Thank You.

  2. #2
    Advanced Member
    Join Date
    Aug 2004
    Location
    Wellington, New Zealand
    Posts
    797
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0
    DOWNLOADING A RESOURCE
    from ALM via QTP:

    workbookname = The name of your resource (not the file name)
    savepath = the local location you want to save the resource to.

    Code:
    	Dim QCResourceManager, ResourceFilter, ResourceList
    	Set QCResourceManager = QCUtil.QCConnection.QCResourceFactory
    	Set ResourceFilter =  QCResourceManager.Filter
    		ResourceFilter.Filter("RSC_NAME") = workbookname
    		ResourceFilter.Filter("RSC_TYPE") = """Test Resource"""
    
    	Set ResourceList = ResourceFilter.NewList()
    
    	If ResourceList.Count <> 1 Then
    		Report "log"
    		Reporter.ReportEvent micFail, "Unable to locate resource: " & workbookname
    		ExitTest
    	Else
    		Set latestfile = ResourceList.Item(1)
    		latestfile.DownloadResource savepath, True
    	End If

    UPLOADING A RESOURCE:

    I haven't uploaded a file, but according to the API docs there is an UploadResource(resourcePath, synchronize) method, with the following notes:

    Parameters:
    resourcePath
    The client path from which to upload the resource. If the path is an empty string, the resource is uploaded from the client cache.
    synchronize
    If True, the operation is synchronous.

    Remarks
    Set QCResource.FileName before uploading or downloading a resource.
    Regards,

    Alex
    ... just another Tester ...

  3. #3
    SQA Knight bklabel1's Avatar
    Join Date
    Sep 2012
    Location
    Kew Gardens, United States
    Posts
    2,596
    Post Thanks / Like
    Blog Entries
    1
    Mentioned
    2 Post(s)
    Tagged
    2 Thread(s)
    Total Downloaded
    0
    Alex,
    I expect to be needing to do something similar in the future. I appreciate you posting the code. I hope that I can find my way back to this post.

    Thanks,
    Kevin

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.54%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 01:49 AM.

Copyright BetaSoft Inc.