Author Topic: get available projects after logging in  (Read 3113 times)

Offline jloyzagadet

  • Newbie
  • *
  • Posts: 22
get available projects after logging in
« on: August 05, 2009, 11:22:47 PM »
QCConnection.InitConnectionEx "http://qualitycenter.det.nsw.edu.au:8080/qcbin/"  gives me a connection and logging in by
QCConnection.Login sUserName, sPassword

but how do I get back the valid domains and projects I am allowed to use?

Offline Tarun Lalwani

  • Administrator
  • Hero Member
  • *****
  • Posts: 2939
    • KnowledgeInbox
Re: get available projects after logging in
« Reply #1 on: August 05, 2009, 11:25:47 PM »
You can use the VisibleDomains and VisibleProjects property of the TDConnection object. Look in the OTA help file for more details and in case you have issues do let me know
Regards,
Tarun
KnowledgeInbox Administrator

KnowledgeInbox" style="border:0

Offline jloyzagadet

  • Newbie
  • *
  • Posts: 22
Re: get available projects after logging in
« Reply #2 on: August 05, 2009, 11:29:38 PM »
I could do this?
QCConnection.InitConnectionEx "http://qualitycenter.test.det.nsw.edu.au:8080/qcbin/" '<------------------- Change me.


QCConnection.Login Uname, Passwd

If (QCConnection.LoggedIn <> True) Then
   MsgBox "QC User Authentication Failed"
   WScript.Quit
End If

Dim sDomain, sProject
'MsgBox QCConnection.Project
Print QCConnection.Server
Print QCConnection.VisibleDomains
Print QCConnection.VisibleProjects

Print QCConnection.Project
Print QCConnection.User


Offline Tarun Lalwani

  • Administrator
  • Hero Member
  • *****
  • Posts: 2939
    • KnowledgeInbox
Re: get available projects after logging in
« Reply #3 on: August 05, 2009, 11:35:37 PM »
Nope. Something like this

Code: [Select]
For each sDomain in QCConnection.VisibleDomains
      Print sDomain
      For each sProject in QCConnection.VisibleProjects(sDomain)
           Print sProject
      Next
Next
Regards,
Tarun
KnowledgeInbox Administrator

KnowledgeInbox" style="border:0

Offline jloyzagadet

  • Newbie
  • *
  • Posts: 22
Re: get available projects after logging in
« Reply #4 on: August 05, 2009, 11:42:15 PM »
could I write each domain as a cell in an array?

Offline jloyzagadet

  • Newbie
  • *
  • Posts: 22
Re: get available projects after logging in
« Reply #5 on: August 05, 2009, 11:43:48 PM »
 Print sDomain

"mismatch" 

but I can see it in the debugger as a value..

Offline Tarun Lalwani

  • Administrator
  • Hero Member
  • *****
  • Posts: 2939
    • KnowledgeInbox
Re: get available projects after logging in
« Reply #6 on: August 05, 2009, 11:51:29 PM »
Try

Print (sDomain)

If that does not work then try

Print CStr(sDomain)

Also for writing the domain names to cell or array you can do it using the loop
Regards,
Tarun
KnowledgeInbox Administrator

KnowledgeInbox" style="border:0

Offline jloyzagadet

  • Newbie
  • *
  • Posts: 22
Re: get available projects after logging in
« Reply #7 on: August 06, 2009, 12:15:39 AM »
      MsgBox mDomain
This works - thats all I need but how come?

Offline Tarun Lalwani

  • Administrator
  • Hero Member
  • *****
  • Posts: 2939
    • KnowledgeInbox
Re: get available projects after logging in
« Reply #8 on: August 06, 2009, 12:38:12 AM »
The value return could be an object with a default value as a string. Variants can be funny at times
Regards,
Tarun
KnowledgeInbox Administrator

KnowledgeInbox" style="border:0

Offline jloyzaga1

  • Newbie
  • *
  • Posts: 10
Re: get available projects after logging in
« Reply #9 on: August 06, 2009, 03:22:24 AM »
wonder whether it will still go into an array properly?

Offline Tarun Lalwani

  • Administrator
  • Hero Member
  • *****
  • Posts: 2939
    • KnowledgeInbox
Re: get available projects after logging in
« Reply #10 on: August 06, 2009, 03:55:03 AM »
Just upto your approach

Code: [Select]
Dim sDomains
ReDim sDomains(QCConnection.VisibleDomains.Count-1)
Dim i
i = 0
For i = 0 to QCConnection.VisibleDomains.Count - 1
    sDomains(i) = QCConnection.VisibleDomains.item(i)
Next
Regards,
Tarun
KnowledgeInbox Administrator

KnowledgeInbox" style="border:0

Offline jloyzaga1

  • Newbie
  • *
  • Posts: 10
Re: get available projects after logging in
« Reply #11 on: August 11, 2009, 04:01:25 AM »
does it means that projects are a subset of domains?
does that explain why autoit doesn't allow projects but its ok with domains?

For $wrk in $tdc.VisibleDomains
    $aArray [$i] = $wrk
   $i += 1
Next
For $wrk1 in $tdc.VisibleProjects
   $aArray1 [$j] = $wrk1
      $j += 1
   Next
 

Offline Tarun Lalwani

  • Administrator
  • Hero Member
  • *****
  • Posts: 2939
    • KnowledgeInbox
Re: get available projects after logging in
« Reply #12 on: August 11, 2009, 04:08:17 AM »
Yes Projects in QC are always a subset of domains and that how they are use to separate  them
Regards,
Tarun
KnowledgeInbox Administrator

KnowledgeInbox" style="border:0

Offline jloyzaga1

  • Newbie
  • *
  • Posts: 10
Re: get available projects after logging in
« Reply #13 on: August 13, 2009, 05:38:26 AM »
so how can I get all available projects with domain called "DEFAULT"

I've got it to work with autoit - login, enter server name, get all available domains, use a combo bow to select which ever domain name you have available after login - but I don't know how to get all projects for selected domain (assuming I selected "DeFAULT" then how to retrieve the projects?

once I can do that I will prompt for report types (test case and/or defect) and then run the vbs report according - its a task I've been asked to do

I'll post the solution when I get it done