Code to Search for an Attachment under a Test Set in Test Lab of ALM (266 Views)
Reply
Occasional Visitor
Tapas_Das
Posts: 1
Registered: ‎12-13-2013
Message 1 of 3 (266 Views)

Code to Search for an Attachment under a Test Set in Test Lab of ALM

I have the following scenario:

 

I have a test set (say, TestSet1) in Test Lab with the following path :

 

<Root> \ Archive \ UFT Automation\

 

There are say 10 test cases associated to the test set 'TestSet1' (say, TC1, TC2, ......, TC10).

 

Now there are 50 test data (excel) files in the Attachment folder associated with the same test set (say, TD1.xls, TD2.xls, ..., TD50.xls). The mapping between the test case and test data sheet are one to one (say, TC1 is mapped to TD1.xls, TC2 is mapped to TD2.xls etc.)

 

Now I have to open each test case in QTP and before executing the same I have to check whether its corresponding test data excel is present in Attachment folder of the same test set, if yes only then the script should execute.

 

Can anyone please provide me the code to accomplish this?

 

HP Expert
Ana_Noncheva
Posts: 245
Registered: ‎08-06-2013
Message 2 of 3 (222 Views)

Re: Code to Search for an Attachment under a Test Set in Test Lab of ALM

Hello,

 

I'd suggest you check ALM OTA API Reference for this purpose (from http://<your ALM server>:8080/qcbin/start_a.jsp > Help > Documentation library). There you can find the suitable objects and properties/methods to use as well as some code examples.

 

Regards,

Ana

“HP Support
If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution.”
Esteemed Contributor
William Schmitt
Posts: 342
Registered: ‎04-02-2008
Message 3 of 3 (218 Views)

Re: Code to Search for an Attachment under a Test Set in Test Lab of ALM

[ Edited ]

If there is a one-to-one mapping of test case to test data xls, why didn't you attach each xls to its test case, rather than attach all of them to a test set.  And if each test case has a test data xls, and the test is a QTP script, why don't you import each data xls as a data table in QTP.  Then you are assured that the data is available for the test, without having to make any checks.  Including the test in a set will automatically run the test with the appropriate data table.  A QTP data table is correct way to associate test data with the test script.

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.