English 中文(简体)
Qtp, export datatable to Quality Center
原标题:

I have my QTP Scripts in Test Scripts Tab and datasheets in the Attachment Tab of TestPlan of QC. I import these datasheets to Datatable (Global) of QTP and use the data in my application using the QTP Script Parameterization and then Script updates this Global Datatable with auto generated values from application.

Now, the issue is when I export the Global Datatable using Export / ExportSheet function back to the Test Data sheets in attachments tab of QC, I don t find the them being updated.

How can I achieve this export of Global Datatable from QTP to Quality Center?

I would like to either save the entire DataTable as a new file or update the DataTable I have in attachments already.

Saving it in the "Test Resources" tab would also be ok.

Actually, any way I could get in into Quality Center make me happy.

Using QTP 10.0 and QC 10.0

Detailed Example:

I have a test that will check the calculated tax for customers buying stuff at a website. And I want to save the result for each row
So I have data table that looks like this

Customer   Item   Expected_Tax   Actual_Tax  Pass_Fail
normal     apple  25             
normal     pear   10             
manager    apple  12             

As I run my tests QTP fill the blanks in the data table

Customer   Item   Expected_Tax   Actual_Tax  Pass_Fail
normal     apple  25             25          pass
normal     pear   10             25          fail              
manager    apple  12             25          fail

Now I want to save this data table, but when the test ends it the data is lost. So I want to save it. I know I can save it locally on my machine. But I want so save it in QC so we can retrive it later.

Update

Turns out that the data table actually is saved and you can find it if you open Test Lab and look at a test run. But I would still like to know how to save the Data Table as a Test Resource or Attachment

最佳回答

Finally found the answer to this one. It s possible to use the QC OTA APIs to export it to QC.

I made a function for this

Function SaveToQC(ResourceName)
       Connection To QC
    Set qcc = QCUtil.QCConnection

       Setting Temp Folder
    TempFolder = environment("SystemTempDir") 

    Set ResourceFactory = qcc.QCResourceFactory
    Set ResourceList = ResourceFactory.NewList("")
    Set Resource = Nothing
    iTotalItems = ResourceList.Count
    For ItemCtr = 1 To iTotalItems
    CurItem = ResourceList.Item(ItemCtr).Name
    If UCase(CurItem) = UCase(ResourceName) Then
        Set Resource = ResourceList.Item(ItemCtr)
    End If
    Next
    Set ResourceFactory = Nothing
    Set ResourceList = Nothing

       Export Datatable to Temp Directory
    Datatable.Export TempFolder & "" & Resource.Filename

    Resource.Post

    Resource.UploadResource TempFolder, True
End Function
问题回答

It s the name of the Resource in the testresources in QC. So if the resource in QC is located at rootTest AutomationDatatable, which has Datatable.xls uploaded in it, you need to pass "Datatable" as ResourceName. I ve used it in my test and this works great. Thanks!





相关问题
Selenium not working with Firefox 3.x on linux

I am using selenium-server , selenium rc for UI testing in my application . My dev box is Windows with FireFox 3.5 and every thing is running fine and cool. But when i try to run selenium tests on my ...

Best browser for testing under Safari Mobile on Linux?

I have an iPhone web app I m producing on a Linux machine. What s the best browser I can use to most closely mimic the feature-limited version of Safari present on the iPhone? (It s a "slimmed down" ...

Code Coverage Tools & Visual Studio 2008 Pro

Just wondering what people are using for code coverage tools when using MS Visual Studio 2008 Pro. We are using the built-in MS test project and unit testing tool (the one that come pre-installed ...

Is there any error checking web app cralwers out there?

Wondering if there was some sort of crawler we could use to test and re-test everything when changes are made to the web app so we know some new change didn t error out any existing pages. Or maybe a ...

热门标签