Overview
When a manual business process testing (BPT) component is ready to be automated, ALM makes it easy to convert to a QuickTest (QTP) scripted component. It is even kind enough to give you this warning:
For any number of reasons, someone might ignore this warning and convert a component that was not meant to be converted. Or perhaps you have a component that simply cannot be automated despite all your hard work, and you want to convert it back to being just a manual test. ALM warned you… conversion “cannot be reversed”. Or can it?
True, ALM does not provide a mechanism for your to reverse your conversion, but you can accomplish the same thing with a little effort. You simply have to undo everything that was done during the conversion. I recently worked though this same issue, and wanted to share the solution for others facing the same challenge.
The process is pretty simple…
- Update the component table to indicate it is a manual component
- Remove the file references from the logical tables of the smart repository
- Remove the user assets associated with the automated component
Disclaimer: Proceed at your own risk! This process was tested on ALM 11 Patch 6 with and without version control enabled, but that does not guarantee it will work for you or that something else is missing from the process. I feel very good about the solution, but you should make a backup of your project “just in case”. This process will not work on QC 10 or prior releases without some modification, but you can use these steps as a guide.
Note on Version Control: If your project is under version control, your steps will vary slightly based on which database tables you update. Each database query is marked to indicate if it is for projects with or without version control enabled.
Prepare the Component
For projects under version control, you will want to check out your component. This will ensure that all your changes can be wrapped up as a single change. More importantly, it should also allow you to revert back to the automated component if needed.
Most importantly, everyone will need to identify the ID of your component. This value will need to be placed in all the SQL queries where you see <ComponentId>.
Update the COMPONENT Table
The COMPONENT table stores the details about your component. Two columns need to be changed to indicate that the component is manual instead of scripted.
Execute this query for projects NOT under version control:
UPDATE component
SET co_script_type = 'MANUAL', co_subtype_id = 'hp.qc.component.manual'
WHERE co_id = <ComponentId>
Execute this query for projects under version control:
UPDATE vc_component
SET co_script_type = 'MANUAL', co_subtype_id = 'hp.qc.component.manual'
WHERE co_id = <ComponentId>
Remove Smart Repository Files
ALM 11 uses a smart repository where one table stores logical references to files, and another table stores the physical location of files. This allows multiple logical files to refer to the same physical file. We need to remove the entries from the logical portion of the smart repository that refer to the QuickTest script of our component.
NOTE: We do not have to delete the physical files. The next time the repository cleanup is initiated by the system, it will remove the physical files that are no longer referenced.
Execute this query for project NOT under version control:
DELETE FROM smart_repository_logical_file
WHERE srlf_parent_path LIKE '.\components\<ComponentId>\COMPONENT_SCRIPT\%'
OR (
srlf_parent_path = '.\components\<ComponentId>\'
AND srlf_name = 'COMPONENT_SCRIPT'
)
Execute this query for projects under version control:
DELETE FROM smart_repository_logical_file
WHERE srlf_parent_path LIKE '.\checkouts\components\<ComponentId>\COMPONENT_SCRIPT\%'
OR (
srlf_parent_path = '.\checkouts\components\<ComponentId>\'
AND srlf_name = 'COMPONENT_SCRIPT'
)
Remove User Assets
The USER_ASSETS table stores the assets associated with your component, and we need to remove any QTP-related assets.
Execute this query for project NOT under version control:
DELETE FROM user_assets
WHERE uas_owner_id = <ComponentId>
AND uas_owner_type = 'COMPONENT'
Execute this query for project under version control:
DELETE FROM vc_user_assets
WHERE uas_owner_id = <ComponentId>
AND uas_owner_type = 'COMPONENT'
Finalize Component in ALM
If you did not log out of your project, you will need to refresh the component within ALM. At this time, ALM should recognize the component as a Manual component!

1 Comment
jack said
good!