BDD Test Cases not able to run on Robot Framework

Is it possible to pass parameters in Gherkin Language

Example :slight_smile:
*** Variables ***
@{DEVICE}= 1 2
&{Identification} = HWID=1 BootloaderID=2 SWID=3
*** Test cases ***
Host details for @{DEVICE}[0]
Given that device @{DEVICE}[0]
When the @{DEVICE}[0] exists and functioning properly
then verify that HWID should be equal to ${Identification.HWID.value}
And BootloaderID should be equal to ${Identification.BootloaderID.value}
And SWID should be equal to ${Identification.SWID.value}

Could you please let me know whether this is possible in Robot Framework with Gherkin Language Syntax. I tried running this test case but I am getting errors.

I am new to Gherkin and Robot Framework.

Ok but not sure why Robot Framework is not able to recognize the above syntax

“Doesn’t work” isn’t very helpful. How about you share details of actual errors ?

1 Like

Sorry, Now attaching the error I am getting
No keyword with name ‘When the @{DEVICE}[0] exists and functioning properly’ found. Did you mean:
the “${Input}” exists and functioning properly

And you have imported the keyword resource file that implements that particular keyword ?

*** Keywords ***
that device 1
BuiltIn.Set Test Message This should be a common setup

the “${Input}” exists and functioning properly
[Arguments] ${Input}
No Operation

I added Keywords in the same file not in a separate file. Do we need to add in separate file?

Your keyword definitions do not match what you are actually trying to call

Rajsani, Thank you for your replies : I have few questions

Why does not robot framework

  • does not call the Keyword "the “${Input}” exists and functioning properly " for Test Case : When the @{DEVICE}[0] exists and functioning properly.

  • Does not expand When the @{DEVICE}[0] exists and functioning properly to When the 1 exists and functioning properly.

Rasjani, Now I understood the problems and syntax.
Thank you very much for all your support

1 Like