TReddy
Veteran
Reged: 01/17/07
Posts: 2565
Loc: Pittsburgh, PA
|
|
Is it possible to read QC manual testcase steps with QTP?
If yes, how?
Thanks, -T Reddy
|
Tarun Lalwani
Veteran
Reged: 07/21/05
Posts: 15329
Loc: Milwaukee, Wisconsin
|
|
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
|
TReddy
Veteran
Reged: 01/17/07
Posts: 2565
Loc: Pittsburgh, PA
|
|
Thanks Tarun, I will give a try tomorrow.
|
TReddy
Veteran
Reged: 01/17/07
Posts: 2565
Loc: Pittsburgh, PA
|
|
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
|
TReddy
Veteran
Reged: 01/17/07
Posts: 2565
Loc: Pittsburgh, PA
|
|
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
|
Tarun Lalwani
Veteran
Reged: 07/21/05
Posts: 15329
Loc: Milwaukee, Wisconsin
|
|
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
|
TReddy
Veteran
Reged: 01/17/07
Posts: 2565
Loc: Pittsburgh, PA
|
|
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.
|
Tarun Lalwani
Veteran
Reged: 07/21/05
Posts: 15329
Loc: Milwaukee, Wisconsin
|
|
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
|
TReddy
Veteran
Reged: 01/17/07
Posts: 2565
Loc: Pittsburgh, PA
|
|
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
|
Tarun Lalwani
Veteran
Reged: 07/21/05
Posts: 15329
Loc: Milwaukee, Wisconsin
|
|
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
|
TReddy
Veteran
Reged: 01/17/07
Posts: 2565
Loc: Pittsburgh, PA
|
|
Many thanks Tarun......
Running QTProfessional.bat solved my problem. I was scratching my head for 2 hours on this yesterday.
|