The online community for software testing & quality assurance professionals
 
 
Calendar   Today's Topics
Sponsors:
Lost Password?

Home
BetaSoft
Blogs
Jobs
Training
News
Links
Downloads



Testing Tools >> HP Functional Testing / Mercury QuickTest Pro / QTP

Pages: 1
TReddyModerator
Veteran


Reged: 01/17/07
Posts: 2565
Loc: Pittsburgh, PA
Reading QC manual testcase steps with QTP?
      #420959 - 10/02/07 03:15 PM

Is it possible to read QC manual testcase steps with QTP?

If yes, how?

Thanks,
-T Reddy


Post Extras: Print Post   Remind Me!   Notify Moderator  
Tarun LalwaniModerator
Veteran


Reged: 07/21/05
Posts: 15329
Loc: Milwaukee, Wisconsin
Re: Reading QC manual testcase steps with QTP? [Re: TReddy]
      #420966 - 10/02/07 03:50 PM

Pseudo Code, might have to tweak it to make it work

Code:

Set oTest = QCUtil.CurrentTest
Set oSteps = oTest.DesinStepFactory
Set allSteps = oSteps.NewList("")

For each oStep in allSteps
Print oStep.StepName
Print oStep.StepDescription
Print oStep.StepExpectedResult
Next



--------------------
Regards,
Tarun
** First ever technical novel - And I thought I knew QTP! **
** Download QTP Unplugged 2nd Edition eBook for FREE **

KnowledgeInbox RSS


Post Extras: Print Post   Remind Me!   Notify Moderator  
TReddyModerator
Veteran


Reged: 01/17/07
Posts: 2565
Loc: Pittsburgh, PA
Re: Reading QC manual testcase steps with QTP? [Re: Tarun Lalwani]
      #420967 - 10/02/07 03:57 PM

Thanks Tarun, I will give a try tomorrow.

Post Extras: Print Post   Remind Me!   Notify Moderator  
TReddyModerator
Veteran


Reged: 01/17/07
Posts: 2565
Loc: Pittsburgh, PA
Re: Reading QC manual testcase steps with QTP? [Re: TReddy]
      #421210 - 10/03/07 08:02 AM

Hi Tarun,

Code:
Set TDConnection = QCUtil.TDConnection
Set treeManager = TDConnection.TreeManager
Set node = treeManager.nodebypath("Subject\Browsers Besides IE6")
Set testList = node.FindTests("Firefox")
Print testList.Count
Set oTest = testList.Item(1)
Print oTest.Name
Set oSteps = oTest.DesignStepFactory
Set allSteps = oSteps.NewList("")

For each oStep in allSteps
Print oStep.StepName
Print oStep.StepDescription
Print oStep.StepExpectedResult
'Print oStep.StepPrerequisite 'Customized QC field
Next



I tried the above code, it work's fine for 3 standard QC fields, but getting an error in retrieving customized QC filed value. I have an additional filed "Prerequisite" in QC.

Print oStep.Prerequisite ' Error: Object doesn't support this method for retrieving Customized QC field value.

Thanks,
-T Reddy


Post Extras: Print Post   Remind Me!   Notify Moderator  
TReddyModerator
Veteran


Reged: 01/17/07
Posts: 2565
Loc: Pittsburgh, PA
Re: Reading QC manual testcase steps with QTP? [Re: TReddy]
      #421288 - 10/03/07 11:10 AM

Any update from senior members here?

I am trying to get params count, but it is always returning zero. I have 4 params for that testcase.

Set TDConnection = QCUtil.TDConnection
Set treeManager = TDConnection.TreeManager
Set node = treeManager.nodebypath("Subject\Browsers Besides IE6")
Set testList = node.FindTests("Firefox")
Print testList.Count
Set oTest = testList.Item(1)
Print oTest.Params.Count 'Params Count

Thanks,
-Reddy


Post Extras: Print Post   Remind Me!   Notify Moderator  
Tarun LalwaniModerator
Veteran


Reged: 07/21/05
Posts: 15329
Loc: Milwaukee, Wisconsin
Re: Reading QC manual testcase steps with QTP? [Re: TReddy]
      #421301 - 10/03/07 11:31 AM

Try this

Msgbox oTest.Params.NewList("").Count

and for oStep.StepPrerequisite you will need to use the actual field name i guess

Print oStep.Field("DS_USER_01")

--------------------
Regards,
Tarun
** First ever technical novel - And I thought I knew QTP! **
** Download QTP Unplugged 2nd Edition eBook for FREE **

KnowledgeInbox RSS


Post Extras: Print Post   Remind Me!   Notify Moderator  
TReddyModerator
Veteran


Reged: 01/17/07
Posts: 2565
Loc: Pittsburgh, PA
Re: Reading QC manual testcase steps with QTP? [Re: Tarun Lalwani]
      #421306 - 10/03/07 11:41 AM

Hi Tarun,
Thanks for the quick update.

Quote:

Msgbox oTest.Params.NewList("").Count



I tried this before and it's giving object doesn't support this method.

Quote:

and for oStep.StepPrerequisite you will need to use the actual field name i guess



You mean to say actual filed name from QC database.

Quote:

Print oStep.Field("DS_USER_01")



This prints nothing.


Post Extras: Print Post   Remind Me!   Notify Moderator  
Tarun LalwaniModerator
Veteran


Reged: 07/21/05
Posts: 15329
Loc: Milwaukee, Wisconsin
Re: Reading QC manual testcase steps with QTP? [Re: TReddy]
      #421312 - 10/03/07 11:50 AM

It won't print anything as i don't know which field you are actually using and you will have to check that in QC customize settings. For the first it should be

oTest.Params.Count only, may be you are not in the correct test. Try using Msgbox oTest.Name to make sure you are using the correct test. And are you using any templates in that test?

--------------------
Regards,
Tarun
** First ever technical novel - And I thought I knew QTP! **
** Download QTP Unplugged 2nd Edition eBook for FREE **

KnowledgeInbox RSS


Post Extras: Print Post   Remind Me!   Notify Moderator  
TReddyModerator
Veteran


Reged: 01/17/07
Posts: 2565
Loc: Pittsburgh, PA
Re: Reading QC manual testcase steps with QTP? [Re: Tarun Lalwani]
      #421322 - 10/03/07 12:11 PM

Tarun,

I am pointing to correct script and able to retrieve data for the standard 3 params with the help of your first reply on this thread.

Print oStep.StepName
Print oStep.StepDescription
Print oStep.StepExpectedResult

Looks like oTest.Params.Count is not working.

Thanks,
-Reddy


Post Extras: Print Post   Remind Me!   Notify Moderator  
Tarun LalwaniModerator
Veteran


Reged: 07/21/05
Posts: 15329
Loc: Milwaukee, Wisconsin
Re: Reading QC manual testcase steps with QTP? [Re: TReddy]
      #421341 - 10/03/07 01:12 PM

It works for me. The key points here are

- A param for a template call is not considered as Test param, it is Step param.
- Parameters sepcified in QTP File->Settings...>Parameters(Tab) should not be confused with there params as they are totally different.

--------------------
Regards,
Tarun
** First ever technical novel - And I thought I knew QTP! **
** Download QTP Unplugged 2nd Edition eBook for FREE **

KnowledgeInbox RSS


Post Extras: Print Post   Remind Me!   Notify Moderator  
TReddyModerator
Veteran


Reged: 01/17/07
Posts: 2565
Loc: Pittsburgh, PA
Re: Reading QC manual testcase steps with QTP? [Re: Tarun Lalwani]
      #421779 - 10/04/07 12:09 PM

Many thanks Tarun......

Running QTProfessional.bat solved my problem. I was scratching my head for 2 hours on this yesterday.


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
0 registered and 30 anonymous users are browsing this forum.

Moderator:  IanFraser, Rajkumar_Rajangam, thorwath, TReddy, AJ, Tarun Lalwani, mwsrosso 

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Topic views: 3500

Rate this topic

Jump to

Contact Us | Privacy statement SQAForums

Powered by UBB.threads™ 6.5.5