tl.addTestCaseToTestPlan

Discussion and information for XML-RPC interface.

Moderators: Amaradana, TurboPT, TL Developers

tl.addTestCaseToTestPlan

Postby testlinkiscool » Mon May 24, 2010 8:27 am

hi, im using the java api and testlink 1.8.5. i really need to add testcases into a testplan. Everything was passed in correctly.


Code: Select all
public static Object[] AddTestcases(String dev_key, int tpid, int Testid,
         String excaseid, int version) {
   
      String[] params = { "devKey", "testprojectid", "testplanid",
            "testcaseexternalid", "version" };
   
      Object[] values = { DEV_KEY, tpid, Testid, excaseid, version };
   
      System.out.println("values:   " + DEV_KEY + " " + tpid + " " + Testid
            + " " + excaseid + " " + version);
      Object[] result = callAddCase("tl.addTestCaseToTestPlan", params,
            values);

   
      return result;

   }


Code: Select all
public static Object[] callAddCase(String method, String[] param,
         Object[] values) {
      try {
         XmlRpcClient rpcClient;
         XmlRpcClientConfigImpl config;
         // tpid = 15;
         config = new XmlRpcClientConfigImpl();
         config.setServerURL(new URL(SERVER_URL));
         rpcClient = new XmlRpcClient();
         rpcClient.setConfig(config);
         // HashMap hm = new HashMap();

         ArrayList<Object> arraylist = new ArrayList<Object>();
         HashMap<String, Object> hm = new HashMap<String, Object>();

         // Hashtable<String, Object> executionData = new Hashtable<String,
         // Object>();
      
         hm = new HashMap<String, Object>();
         for (int i = 0; i < param.length; i++) {
            hm.put(param[i], values[i]);
            
         }

         arraylist.add(hm);
      
         System.out.println(arraylist);
         Object[] result = (Object[]) rpcClient.execute(
               "tl.addTestCaseToTestPlan", arraylist);
      
         return result;
      } catch (Exception e) {
         return null;
      }

   }


No errors were shown. However, testcases that were added into a particular testplan did not appeared after i run this methods.. sigh... :(
testlinkiscool
Advanced user
 
Posts: 24
Joined: Mon May 24, 2010 2:24 am

Re: tl.addTestCaseToTestPlan

Postby fman » Mon May 24, 2010 9:01 pm

till we will have time to give a look, you can try adding debug on xmlrpc.php code and use the php examples.
I know is the solution, but can help if you can not wait

Anyway try with included PHP examples, because you can have more debug info (IMHO)
fman
Member of TestLink Community
 
Posts: 3062
Joined: Tue Nov 15, 2005 7:19 am

Re: tl.addTestCaseToTestPlan

Postby testlinkiscool » Tue May 25, 2010 1:54 am

Hi fman,
first thing first, thank you for your reply. I only have the client side api with me. The xmlrpc.php shld be located at the server side right? Currently i don't have access to it, i wanted to know if am i the only person that got this bug on 1.8.5? or wait for version 1.9 beta 5 to come out?
testlinkiscool
Advanced user
 
Posts: 24
Joined: Mon May 24, 2010 2:24 am

Re: tl.addTestCaseToTestPlan

Postby fman » Tue May 25, 2010 4:46 am

1. you can install a local copy to play with xmlrpc.php
2. for issues is better to use mantis,and then search there to understand if this is an issue, and has been already reported
fman
Member of TestLink Community
 
Posts: 3062
Joined: Tue Nov 15, 2005 7:19 am

Re: tl.addTestCaseToTestPlan

Postby testlinkiscool » Tue May 25, 2010 5:29 am

1)ok, i will look more into it. :D
2)yeah, i reported this as an issue in testlink mantis. :D
testlinkiscool
Advanced user
 
Posts: 24
Joined: Mon May 24, 2010 2:24 am

Re: tl.addTestCaseToTestPlan

Postby testlinkiscool » Tue May 25, 2010 9:21 am

hi fman, i have installed testlink on localhost. however,what do you mean debug on xmlrpc.php? and where can i locate the php examples? if its cool with you, mind just telling me where to edit and the possibly most direct solution.
testlinkiscool
Advanced user
 
Posts: 24
Joined: Mon May 24, 2010 2:24 am

Re: tl.addTestCaseToTestPlan

Postby fman » Tue May 25, 2010 6:59 pm

See mantis issue for info regarding how to fix it
fman
Member of TestLink Community
 
Posts: 3062
Joined: Tue Nov 15, 2005 7:19 am

Re: tl.addTestCaseToTestPlan

Postby testlinkiscool » Wed May 26, 2010 8:53 am

check out mantis
testlinkiscool
Advanced user
 
Posts: 24
Joined: Mon May 24, 2010 2:24 am

Re: tl.addTestCaseToTestPlan

Postby AutoTestLink » Mon Sep 06, 2010 6:17 am

Hi fman and testlinkcool,
Request you for the mantis URL to check for the defect logged for this method in mantis.

I am getting a similar issue with "addTestCaseToTestPlan".
I am using TestLink 1.8.5 with WAMP.
I tried using Sample client "addTestCaseToTestPlan" php version.
I am getting the following error message when is pass correct values for parameters, both required and optional.
"<br />
<b>Fatal error</b>: Call to undefined function reportFatal() in <b><testlinkinstallpath>\testlink\lib\functions\database.class.php</b> on line <b>193</b><br />

something went wrong - -32700 - parse error. not well formed


Result was: NULL".

But if I pass wrong values to parameters I get the correct error message displayed.
For Example: Test case ID does not exists or invalid value for parameter.

Please help.
AutoTestLink
TestLink user
 
Posts: 4
Joined: Thu May 27, 2010 12:40 pm

Re: tl.addTestCaseToTestPlan

Postby fman » Mon Sep 06, 2010 7:53 am

Please stop this thread, is this is a bug has to be followed on mantis
error you got regarding repotFatal(), has been reported and fixed => search on mantis wihtoit hiding status
fman
Member of TestLink Community
 
Posts: 3062
Joined: Tue Nov 15, 2005 7:19 am

Re: tl.addTestCaseToTestPlan

Postby AutoTestLink » Mon Sep 06, 2010 12:55 pm

Hi Fman,
Please read my request again, I only want the Mantis URL and the defect id mapped to this issue. I am not opening this issue again. I know this issue is closed.

Thanks for your help.
AutoTestLink
TestLink user
 
Posts: 4
Joined: Thu May 27, 2010 12:40 pm

Re: tl.addTestCaseToTestPlan

Postby fman » Mon Sep 06, 2010 8:40 pm

Sorry very much but to give info you are requested I need to do same work you have to do: search on mantis.
you can access mantis using the tracker link on left side on home page of www.teamst.org
fman
Member of TestLink Community
 
Posts: 3062
Joined: Tue Nov 15, 2005 7:19 am


Return to XML-RPC API



Who is online

Users browsing this forum: No registered users and 2 guests

cron