Quality Center / ALM Practitioners Forum
cancel

Field < Status > requires a value from the corresponding list

Highlighted
Nitin_k29
Absent Member.

Field < Status > requires a value from the corresponding list

Hi,

I an trying to write an exe using QC OTA to update the status of my test cases in QC.I am facing two issues:

1. When I am using    run.Status ="Pass"; getting an error saying Field < Status > requires a value from the corresponding list

2. How to provide several other information for test case updation like OS,Locale,IE version, Product Version.

I am using QC 10.0.0.2248 on Win7 SP1 Ultimate32 bit

My code snippet is

 foreach (TSTest tsTest in tsTestList) 

    {  Console.WriteLine(tsTest.Name);

        Run lastRun = (Run)tsTest.LastRun;
        Console.WriteLine(lastRun.Name);      
        RunFactory runFactory = (RunFactory)tsTest.RunFactory;
        String date = DateTime.Now.ToString("yyyyMMddhhmmss");
        Run run = (Run)runFactory.AddItem("Run" + date);
        run.Status =  "Pass";
        run.Post();

    }

 

Any help in this regard is highly appreciated as this is the first time I am using QC.

3 REPLIES
A_RuhlandK
Absent Member.

Re: Field < Status > requires a value from the corresponding list

Status "Pass" is not a value from the Status list for Run/Test/... You can check it in QC itself. Your value should be "Passed".

 

A test instance has not OS,Locale,IE version, Product Version as system fields, you have to add these in the customization. Afterwards, you are able to enter these data.

 

HTH,

 

Armin

 

Nitin_k29
Absent Member.

Re: Field < Status > requires a value from the corresponding list

Thanks Armin,

 

I have all these 4 fields in my test instance properties window in QC.

But even then I am unable to access them.

I want to retrive the values for last run and set values for the current run.

foreach (TSTest tsTest in tsTestList)
                {

                   
                //Console.WriteLine(tsTest.Name);
                Run lastRun = (Run)tsTest.LastRun;
                   
                string g = lastRun["Browser Version"].ToString();   //getting invalid file name exception

                //Console.WriteLine(lastRun.Name);
                RunFactory runFactory = (RunFactory)tsTest.RunFactory;
                String date = DateTime.Now.ToString("yyyyMMddhhmmss");
                Run run = (Run)runFactory.AddItem("Run_"  + date);
               
                run.Status = status;
                run["Browser Version"] = "IE 9.x";      //getting invalid file name exception
                    
                run.Post();
                Console.WriteLine(status + "  " + tsTest.Name);
                } 

 

 

It would be great If you could provide a link to some code examples.

RoniRobinson
Absent Member.

Re: Field < Status > requires a value from the corresponding list

Check the Documentation Library found under the Help link.  You will find the OTA documentation here.  You will need to save the file locally before opening.  If you attempt to open from the Help link, you will receive an "unable to display web page" error.