--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To post to this group, send email to robotframe...@googlegroups.com.
To unsubscribe from this group, send email to robotframework-u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/robotframework-users?hl=en.
I agree that this would be a very useful feature in Robot Framework and I asked for it a few years ago
http://code.google.com/p/robotframework/issues/detail?id=319
Unfortunately the RF developers said it was "too hard" to do and marked the issue WONTFIX.
You can fake this behavior by moving all your steps for a test into a user-defined keyword and then looping execution of the keyword with a :FOR, but that really defeats the purpose of test case reuse. It would mean that ALL test cases would have to be written as user-defined keywords and every test case would be a single line, calling the corresponding user-defined KW. That's a PAIN to maintain, so I've only ever done this for a few select tests and I end up with steps to maintain in the user-defined KW AND in the original test case.
Cheers,
Martin
Hi,
--
I've never figured out the use of Test Template, so I don't understand why it would be useful in this context of being able to call a test case from inside another test case. Please explain.
Thanks,
After reading comments on the issue you linked in your first post and some other related posts, I don't think that Test Template is the right tool for what you are trying to do.
RoboMachine might be :P
Also the Parallel library 1# has the ability to execute tests from inside of another tests. This is done in another pybot process - so that might be a problem.
1# http://code.google.com/p/robotframework/source/browse/proto#proto%2Fparallel
--
Mikko Korpela
This is a very good general approach. If you have a finite set of
values you want to go through, it might be easier to simply create
"normal" data-driven test cases [1]. These two approaches can also be
combined by using for loops with test templates [2].
[1] http://robotframework.googlecode.com/hg/doc/userguide/RobotFrameworkUserGuide.html#data-driven-style
[2] http://robotframework.googlecode.com/hg/doc/userguide/RobotFrameworkUserGuide.html#test-templates
If you are interested about model-based testing, then looking at
RoboMachine proposed by Mikko is probably a good idea.
Cheers,
.peke
--
Agile Tester/Developer/Consultant :: http://eliga.fi
Lead Developer of Robot Framework :: http://robotframework.org
The main reasons we decided not to implement this issue were that a)
implementation is far from trivial, b) there are many open questions
regarding where keywords and variables used by the executed tests
should be searched from, and c) it is possible to use user keywords
for this purpose. Keywords are also more flexible and easier to reuse
as they can take arguments.
We don't, however, have anything against adding this feature if the
community considers this an important feature and someone is willing
to implement it.
void main()
{
int number;
cout << "Enter number: ";
cin >> number;
for(int i = 2; i <= number; i++)
{
int prime = 1;
for(int j = 2; j <= i/2; j++)
{
if ((i%j) == 0)
{
prime = 0;
break;
}
}
if (prime == 1)
{
cout << setw(10) << i << endl;
}
}
}