Forum Discussion
- Hi!
hmm... exactly how are you cloning the testcase? can you show your code?
regards!
/Ole
eviware.com - hazem_borhamOccasional ContributorThanks for the reply. Here's my script
def targetProject = testSuite.getProject()
targetTestSuite = targetProject.getTestSuiteAt(0)
targetTestCase = targetTestSuite.getTestCaseByName("TestCase 1")
//clone test case.
targetTestSuite.cloneTestCase(targetTestCase, "TestCase 2") - scrOccasional ContributorEither clone your test case before you run the first case, or specifically run the second case after you clone it... It's probably not running due to the semantics involved with the order of your operations here.
- Hi!
hmm.. i don't really understand.. if you are cloning a testcase in another testsuite than your executing one, that will obviously not be executed since it isn't part of the current testcase.. or do you want to clone it into the current testsuite? or are you running the entire project?
please clarify :-)
regards!
/ole
eviware.com - hazem_borhamOccasional ContributorThe cloned testcase is within the testsuite that I am executing, and I am running the entire project.
My goal is to clone the master testcase and have both (the master and clone) executed and reported on in junit report. I'd like for this all to happen at run time.
Any ideas on how to accomplish this? - Hi,
I've created the following testsuite setup script:for( tc in testSuite.testCaseList )
{
if( tc.name.endsWith( "- Clone" ))
testSuite.removeTestCase( tc )
else
testSuite.cloneTestCase( tc, tc.name + " - Clone" )
}
which basically clones all TestCases in the testSuite (and removes any old clones first). This seems to work ok when running both at project or testsuite level..
Can you use this somehow? Are you using an updated build?
regards!
/Ole
eviware.com - hazem_borhamOccasional ContributorThanks for the help. This works fine now. I think the issue was with 2.5.1 since it works on 3.0.1.
Thanks again,
Haz - rnavaretteNew ContributorI'm trying to do something similar to this where the tests are created as part of my testsuite setup script and removed in the teardown. In the SoapUI application window, this seems to give me what I'm looking for. But, when this is run from the commandline, I can see that the tests are run (by watching the output they produce), but I don't think they are properly hooked into the runner. I use the -r option to output the test summary and these tests are never counted as having run. I've even tried not deleting the cloned test and that has no effect on the results output either.
So, it seems that while the tests are run, their results are not tracked. I've tried using the importTestCase method and setting the copy parameter also, but this has the same effect. Any thoughts as to what I need to do to be able to copy, run, and track the results of the cloned tests all at once?
Thanks,
ray - Hi Ray,
you are right, this is a limitation in the command-line runners; they won't register results for dynamically created testcases.. you could get around this by performing your setup script in the project load script (you could check for some system variable to enable/disable this behavior)
regards,
/Ole
eviware.com - rnavaretteNew ContributorI'll give this a shot... thanks for the quick update.