How to set a value in Test Result (migrated thread) Posted: Jul 5, 2012 9:17 AM
dkwq67 Posts: 10 Registered: May, 2012
Hi,
I have a added a new field in Test Result as "Result Data".
I can able to update the field "Annotation". I cannot able to update in new field".
Script:
========================================================
cmdrunner.setCommand("tm", "editresult");
cmdrunner.addOption("Results Data", results[k]);
cmdrunner.addOption("forcecreate");
cmdrunner.addOption("sessionId", SessionID);
=======================================================
while executing this script i am getting the below error:
2012-07-05 07:59:43,252 DEBUG [mksis.IntegrityServer] DEBUG(10): command=tm.EditTestResults; rc=1; mem=(total:1028456448,free:594150272); rmi=(in:0,out:0)
2012-07-05 07:59:43,252 INFO [mksis.IntegrityServer] GENERAL(0): Caught exception mks.frame.triggers.TriggerAPIException: [API-editresult]: tm: MKS124819: Invalid option: "Test Results"
Thanks in advance
shankar
| Re: How to set a value in Test Result | Posted: Jul 6, 2012 2:58 PM |
| | Posted By: tudor.costache Posts: 2 / Registered: Dec, 2009 | Hi Shankar,
Your best bet here is to try to use the 'tm editresult' CLI command before passing this into the API script. If the CLI command also fails please work with customer service to troubleshoot the error message.
~Tudor PTC Integrity Support |
|
| Re: How to set a value in Test Result | Posted: Jul 12, 2012 7:52 AM |
| | Posted By: dkwq67 Posts: 10 / Registered: May, 2012 | Hi,
1. I have added a new field in "Test Result Feilds" as "Annotation Template". 2. I would like to update the field "Annotation Template" through API.
Script: ========
var cmdrunner = api_bean.createAPICommandRunnerBean(); cmdrunner.setCommand("tm", "resulteditor"); cmdrunner.addOption("Annotation Templates", 'Result'); cmdrunner.addOption("forcecreate"); cmdrunner.addOption("sessionId", SessionID); cmdrunner.addSelectionElement(k); cmdrunner.execute();
While executing the script I got the below error:
ERROR * * * * (0): Internal error, no model setting for cli flag: displayFields 2012-07-12 07:18:25,795 DEBUG [mksis.IntegrityServer] DEBUG(10): command=tm.TestResultEditor; rc=1; mem=(total:1027735552,free:647559264); rmi=(in:0,out:0) 2012-07-12 07:18:25,795 INFO [mksis.IntegrityServer] GENERAL(0): Caught exception mks.frame.triggers.TriggerAPIException: [API-resulteditor]: tm: MKS124819: Invalid option: "Annotation Templates" |
|
| Re: How to set a value in Test Result | Posted: Jul 26, 2012 3:57 AM |
| | Posted By: cstoss Posts: 46 / From: United Kingdon / Registered: Jun, 2005 | This occurs because of this line: cmdrunner.addOption("Annotation Templates", 'Result');
The first argument in an Option Object must always be a valid option for the command, "Annotation Templates" is not.
What you are looking for is this Option:
--field=value Where 'value' is 'fieldName=fieldValue'
So something like this as an example: cmdrunner.addOption("field", "Annotation Templates=Result");
Regards,
Craig |
|
Kind Regards,
Kael Lizak
Senior Technical Support Engineer
PTC Integrity Lifecycle Manager