Allen,
On 4/2/16 8:59 AM, Allen Zhang wrote:
> In Robot Framework, you can create a variable file, with all your
> variable definitions in that file. And in your test cases, you just need
> to refer to that file, it will replace the variables with the definition
> in that file.
The short answer is that you give you entity that needs to vary a
logical name. Use that name in the gherkin, and let your step definition
look up the value.
As Thomas and Roberto mentioned, a property file is a common choice
because it's trivial to read in Java. You can write Java code to read
the actual values from anywhere, of course.
> So, currently, I want to reuse the Robot framework test cases in my Java
> cucumber test. Please notice, it is cucumber Java test, not the Cucumber
> for Ruby. I know ruby has some configuration file, cucumber.yml, but
> seems Java does not support it.
Even if you were using Ruby, I don't think you'd get what you want from
the cucumber.yml file. It provides the options to the cucumber runner.
And unless your Robot keywords are in gherkin, you'll need to make some
changes, anyway.
> Does anyone has any experience on it?
Yes, there's lots of cucumber experience here, but not much experience
on your particular situation. Perhaps if you posted a Robot Framework
test we could help you translate it.
- George
--
----------------------------------------------------------------------
* George Dinwiddie *
http://blog.gdinwiddie.com
Software Development
http://www.idiacomputing.com
Consultant and Coach
http://www.agilemaryland.org
----------------------------------------------------------------------