Replacing existing test in QC
Question ID: 104209
0
0

We have 2 QC projects. 1 is a ‘test’ project where we create new QTP script and test them from. When they are complete, we move them to a ‘production’ project. We also update/edit and test them in the ‘test’ project before moving them to the ‘production’ project. The Production project is used strictly for actual execution and run history.

The problem we are having is, if we update an existing QTP test in the ‘test’ project, when we copy it over to the ‘production’ project, it renames it. If we delete the old script to replace it with the new, all the run history gets deleted as well.

Also, if there is an existing manual test in the ‘production’ project, how can we save it’s automated script from the ‘test’ project without deleting it and re-importing it?

Is this just a bad way of doing things? Should we be doing all our QTP script development in the ‘production’ project and scrap the test project?

Marked as spam
Posted by (Questions: 16, Answers: 807)
Asked on September 1, 2010 4:27 pm
37 views
Answers (1)
0
Private answer

I think this can be done with some work and testing. How I see it you will have to open the development project test and extract the scripts and save them to local file. Then open the production test and import the test. You will have to use HP QTP Automation Object Model (ATOM). Here is the core code to get the development test script and change a target location for a starter.

`
Dim App 'As Application
Set App = CreateObject(''QuickTest.Application'')
App.Launch
App.Visible = True
App.Open ''S:SharedCalculator''

For cnt =1 to App.Test.Actions.count
myTestName= App.Test.Actions(cnt).Name
MsgBox App.Test.Actions(cnt).GetScript
'change the code for Action green
If myTestName =''Green'' Then
myContent= ''MSGBOX BINGO''
App.Test.Actions(cnt).setscript mycontent
End If
Next
`

Marked as spam
Posted by (Questions: 2, Answers: 98)
Answered on September 8, 2010 5:16 pm
0
This will need to be expanded to get file from QC then save it local then get the production project test.
( at September 8, 2010 8:49 pm)
EyeOnTesting

Welcome back to "EyeOnTesting" brought to you by Orasi Software, Inc.

X
Scroll to Top