- Community Home
- >
- Software
- >
- Agile Planning and Lifecycle
- >
- QC/ ALM
- >
- QC / ALM Practitioners
- >
- QC Projects Error when backing up through VBScript
-
Communities
-
Blogs
-
Quick LinksProtect724English
QC Projects Error when backing up through VBScript
SOLVED- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-22-2016 08:44 AM
11-22-2016 08:44 AM
Mod Message: This post was split from an inactive topic. Refer this link for old topic.
=================================xxx=============================================
Is there a solution of this question asked a few years ago? I am having the similar error for the same VBA code. Unless I am mistaken, the problem doses not look to me arising from the split command in relations to semi colon and colon. Here is a reference to this code that has more info: http://qualitesting.blogspot.ca/2013/01/how-to-make-scheduled-backup-qc-project.html
Currently, it fails on the following line: sa.ExportProject v_domain, v_project, v_fileName with error message: "Run-time error '-2147220350 (80040482): Invalid server response [ERR-SEP]. Any feedback to correct this error will be appreciated.
Thank you in advance.
Code:
Sub ALM_Backup() Dim v_qcURL, sa, v_username, v_paswordDim v_domain, v_project, v_date, v_fileName, bugId, v_summaryDim v_projectList, v_domainProject, v_domainProjectArray ' The following code is to move the existing files from to source to destination folder Dim fsoDim sfol As String Dim dfol As Stringsfol = "C:\ALM Backup"dfol = "C:\ALM Backup Archive" Set fso = CreateObject("Scripting.FileSystemObject")
fso.MoveFile (sfol & "\*.*"), dfol 'Change "\*.*" to "\*.qcp"
v_qcURL = "https://qcurl"
v_projectList = "Domain1:Project1;Domain2:Project2;Domain3:Project3"
v_username = "userid"v_password = "password" For Each v_domainProject In Split(v_projectList, ";")
v_domainProjectArray = Split(v_domainProject, ":")
v_domain = v_domainProjectArray(0)
v_project = v_domainProjectArray(1)
v_year = Year(Now)
v_month = Month(Now)
v_day = Day(Now)
v_hour = Hour(Now)
v_minute = Minute(Now)
v_second = Second(Now) If v_month < 10 Then
v_month = "0" & v_month End If
If v_day < 10 Then
v_day = "0" & v_day End If
If v_hour < 10 Then
v_hour = "0" & v_hour End If
If v_minute < 10 Then
v_minute = "0" & v_minute End If
If v_second < 10 Then
v_second = "0" & v_second End If
v_date = v_year & v_month & v_day & v_hour & v_minute & v_second v_fileName = "C:\ALM_Backup" & v_date & "_" & v_project & ".qcp"
v_summary = "For project <" & v_domainProject & "> backup started: " & v_date bugId = openDefect(v_summary) Set sa = CreateObject("SAClient.SaApi")
sa.Login v_qcURL, v_username, v_password sa.SendAllQualifiedNow "IT", "QA_Internal_Projects"
sa.SendMessageToProjectConnectedUsers v_domain, v_project, "This project is going to be deactivated due to maintenence."
sa.DisconnectProject v_domain, v_project sa.DeactivateProject v_domain, v_project
' Following line is generation error sa.ExportProject v_domain, v_project, v_fileName sa.ActivateProject v_domain, v_project Set fs = CreateObject("Scripting.FileSystemObject") Set f = fs.GetFile(v_fileName)
fixAndCloseDefect bugId, v_fileName & ": " & Round((f.Size / 1024) / 1024, 2) & " MB"
sa.SendAllQualifiedNow "IT", "QA_Internal_Projects" Next
sa.Logout End Sub Function openDefect(p_summary)
v_detectionDate = Day(Now) & "." & Month(Now) & "." & Year(Now)
If Day(Now) < 10 Then
v_detectionDate = "0" & Day(Now) & "." & Month(Now) & "." & Year(Now) End If
If Month(Now) < 10 Then
v_detectionDate = Day(Now) & ".0" & Month(Now) & "." & Year(Now) End If
If Month(Now) < 10 And Day(Now) < 10 Then
v_detectionDate = "0" & Day(Now) & ".0" & Month(Now) & "." & Year(Now) End If Set tdc = CreateObject("TDApiOle80.TDConnection")
tdc.InitConnectionEx "http://qcurl"
tdc.Login "userid", "password"
tdc.Connect "IT", "QA_Internal_Projects" Set bfact = tdc.BugFactory Set mybug = bfact.AddItem(Null)
mybug.Summary = p_summary mybug.Status = "Open"
mybug.Field("BG_SEVERITY") = "2-Medium"
mybug.DetectedBy = "userid"
mybug.Field("BG_DETECTION_DATE") = Date
mybug.Post bugId = mybug.ID tdc.Logout tdc.Disconnect openDefect = bugId
End Function Function fixAndCloseDefect(p_bugId, p_comment) Set tdc = CreateObject("TDApiOle80.TDConnection")
tdc.InitConnectionEx "https://qcurl"
tdc.Login "userid", "passsword"
tdc.Connect "IT", "QA_Internal_Projects" Set bfact = tdc.BugFactory Set bgfilter = bfact.Filter bgfilter.Filter("BG_BUG_ID") = p_bugId Set bglist = bgfilter.NewList For Each theBug In bglist Set bg = bfact.Item(theBug.ID)
bg.Field("BG_STATUS") = "Closed"
bg.Field("BG_DEV_COMMENTS") = "Backup completed on <backup_host>: " & p_comment bg.Post Next
tdc.Logout tdc.Disconnect
End Function
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-22-2016 02:32 PM
11-22-2016 02:32 PM
SolutionI found the reason why the error was generating.
I have just changed v_fileName variable to have a slash
Previously it was:
v_fileName = "C:\ALM_Backup" & v_date & "_" & v_project & ".qcp"
Changed to:
v_fileName = "C:\ALM_Backup\" & v_date & "_" & v_project & ".qcp"
The reason the error was happening because without the newly added backslash after "ALM_Backup", the program was trying to save the file inside the C directory not the C:\ALM_Backup directory.
The code is working now and I am able to backup projects into qcp files.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-22-2016 09:39 AM
11-22-2016 09:39 AM
Re: Error while taking Backup of QC Projects through VBScript
Re: Error while taking Backup of QC Projects through VBScript
Based in the code, you want to backup all your project defects, please let me know if I am right.
cordially
If you find this or any post resolves your issue, please be sure to mark it as an accepted solution"
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-22-2016 01:57 PM
11-22-2016 01:57 PM
Re: Error while taking Backup of QC Projects through VBScript
Re: Error while taking Backup of QC Projects through VBScript
Thanks for your response. I am trying to export all projects in the following string into .qcp files
v_projectList = "Domain1:Project1;Domain2:Project2;Domain3:Project3"
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-22-2016 02:32 PM
11-22-2016 02:32 PM
SolutionI found the reason why the error was generating.
I have just changed v_fileName variable to have a slash
Previously it was:
v_fileName = "C:\ALM_Backup" & v_date & "_" & v_project & ".qcp"
Changed to:
v_fileName = "C:\ALM_Backup\" & v_date & "_" & v_project & ".qcp"
The reason the error was happening because without the newly added backslash after "ALM_Backup", the program was trying to save the file inside the C directory not the C:\ALM_Backup directory.
The code is working now and I am able to backup projects into qcp files.
-
Sudhanshu53
on: Database query to get total no of test cases in a given time period.
-
Dirk Hedderich
on: HP ALM Software Install
-
Carlos_S_ALM
on: How to add attachment to defect via REST API ?
-
Srihari_Amgen
on: Help with HP-ALM 12.55 Install please (SQL Server database connection issue)
-
tooldiva
on: Test Status "No Run" when all steps Passed
-
AlexandreBueno
on: ALM API connection - Excel(32bits) closes/crashes without any error message
-
Carlos_S_ALM
on: New Version of QC Project Insight on AppDelivery Marketplace
-
Jas1
on: Display Warning of Downtime in ALm Login Screen
-
Srihari_Amgen
on: Can someone help me on updating the query to extract ALM defects w/ linked test instance a...
-
Damodar-Reddy
on: HP ALM client shows cut off descriptions