Page 1 of 1

tl.addTestCaseToTestPlan

Posted: Mon May 24, 2010 8:27 am
by testlinkiscool
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... :(

Re: tl.addTestCaseToTestPlan

Posted: Mon May 24, 2010 9:01 pm
by fman
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)

Re: tl.addTestCaseToTestPlan

Posted: Tue May 25, 2010 1:54 am
by testlinkiscool
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?

Re: tl.addTestCaseToTestPlan

Posted: Tue May 25, 2010 4:46 am
by fman
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

Re: tl.addTestCaseToTestPlan

Posted: Tue May 25, 2010 5:29 am
by testlinkiscool
1)ok, i will look more into it. :D
2)yeah, i reported this as an issue in testlink mantis. :D

Re: tl.addTestCaseToTestPlan

Posted: Tue May 25, 2010 9:21 am
by testlinkiscool
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.

Re: tl.addTestCaseToTestPlan

Posted: Tue May 25, 2010 6:59 pm
by fman
See mantis issue for info regarding how to fix it

Re: tl.addTestCaseToTestPlan

Posted: Wed May 26, 2010 8:53 am
by testlinkiscool
check out mantis

Re: tl.addTestCaseToTestPlan

Posted: Mon Sep 06, 2010 6:17 am
by AutoTestLink
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.

Re: tl.addTestCaseToTestPlan

Posted: Mon Sep 06, 2010 7:53 am
by fman
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

Re: tl.addTestCaseToTestPlan

Posted: Mon Sep 06, 2010 12:55 pm
by AutoTestLink
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.

Re: tl.addTestCaseToTestPlan

Posted: Mon Sep 06, 2010 8:40 pm
by fman
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