替换特定文件夹中的所有内容

Replace all in a specific folder

在我的测试计划中,我有两个文件夹。一个包含我所有的活动测试用例,一个包含我所有的存档测试用例。我需要将很多 'Affected Module' 从一个值替换为另一个值,但是 - 我不希望存档的文件夹受此影响。

那么,有没有办法在 HP ALM 中仅对特定文件夹(以及所有子文件夹)进行搜索和替换?

据我所知,网格视图中的搜索和替换功能会替换该值的所有实例,因此我不能直接使用它。

这是一个简单的 OTA 代码,用于将文件夹 Subject\Automated 中所有测试用例的字段 ts_user_04 及其 sub-folder 从任何值更新为 Quoting

请根据您的要求更改列名称。如果您有权访问 Management 选项卡,则可以通过转到 Management 选项卡轻松找到 HP ALM 中任何字段的 DB 列。即便如此,您也可以使用 OTA 获取所有映射。 (我希望你有必要的访问权限)

为了运行 OTA代码,您需要安装ALM Connectivity add-in,您可以从工具中获取它ALM 主页中的部分

Public TDconnection
Public reqPath
Public testPath

'Call the main Function
updateAllTests



Public Function login()
    Dim almURL, almUserName, almPassword, domain, project
    almURL = "https://.saas.hp.com/qcbin/"

    almUserName = ""
    almPassword = ""
    domain = ""
    project = ""    
    testPath = "Subject\Automated" ' Change it as per your folder structure

    Set TDconnection = CreateObject("tdapiole80.tdconnection")
    TDconnection.ReleaseConnection
    TDconnection.InitConnectionEx almURL
    TDconnection.login almUserName, almPassword
    TDconnection.Connect domain, project

End Function


Public Function updateAllTests()
    login   
    Set TreeMgr = TDconnection.TreeManager
    Set TestTree = TreeMgr.NodeByPath(testPath)
    If Err.Number = 0 Then
        Set comm = TDconnection.Command
        comm.CommandText = "update test set ts_user_04='Quoting' where ts_test_id in (select ts_test_id from test, all_lists where ts_subject in (select al_item_id from all_lists where al_absolute_path like (select al_absolute_path from all_lists where al_item_id=" & TestTree.NodeID & ") || '%' ) and ts_subject = al_item_id)"
        comm.Execute
    End If
    logout
    MsgBox "Flag Update successful", vbInformation
End Function

Public Function logout()
    TDconnection.Disconnect
    TDconnection.logout
    TDconnection.ReleaseConnection
    Set TDconnection = Nothing
End Function