I am trying to extract the UFT (v12.02) scripts from ALM (v12.00) and I could use the community's help.
I have found the following piece of C# code that does the trick. The only thing is that in some of the folders created apart from the scripts (Action0 and Action1 plus some config files) I see some subfolders named with names like 0_3018 as in the screenshot that contain a Report folder. Are these test run reports? If it is the case is there a way to exclude them from downloading?
I am attaching the piece of code that does the trick (Common.sSourcePath is the folder path in ALM Test Plan that contains the tests I want to download)
TestFactory testFactory = ConnectionConfig.Instance.qctd.TestFactory;
TDFilter filter = (TDFilter)testFactory.Filter;
filter["TS_TYPE"] = "QUICKTEST_TEST";
List tests = testFactory.NewList(filter.Text);
foreach (Test tst in tests)
string testStr = tst["TS_SUBJECT"].Path.ToString();
path = Path.Combine(Common.sStoragePath, "UFT_TESTS", testStr.Replace(@"Subject\", string.Empty), tst.Name);
testStorage = tst.ExtendedStorage;
testStorage.ClientPath = path;
string testDownLoadPath = testStorage.LoadEx("", true, out nullList, out isFatalErr);