Beliebte Suchanfragen

Cloud Native

DevOps

IT-Security

Agile Methoden

Java

|
//

Localizing Your Acceptance Tests With The Robot Framework

6.4.2010 | 1 minutes of reading time

When doing acceptance test driven development, the team writes the tests often by first specifying the behaviour, and then supporting that with a table of examples. How that generally works with the Robot Framework, was already described earlier . As executable specification, those automated tests have to be understandable by all stakeholders. By all means, this includes that they should be written in everybody’s mother tounge – and more often than not, this is not English. This currently does not work with the Robot Framework, does it?
With a simple resource file, you can easily work around that issue, until it will be solved with the forthcoming Robot Framework 2.5 .

1*** Settings ***
2 
3 
4*** Keywords ***
5Gegeben ${keyword}
6    Run Keyword  ${keyword}
7 
8Sei ${keyword}
9    Run Keyword  ${keyword}
10 
11Wenn ${keyword}
12    Run Keyword  ${keyword}
13 
14Dann ${keyword}
15    Run Keyword  ${keyword}
16 
17Und ${keyword}
18    Run Keyword  ${keyword}

Now a test can be written easily, like shown in the example below:

1*** Settings ***
2Resource        ${RESOURCES}/German-BDD.txt
3 
4*** Keyword ***
5Verhalten
6    [Arguments]  ${arg1}  ${xyz}
7 
8    Sei dies, und auch ${arg1} noch gegeben
9    Und das hier ebenso
10 
11    Wenn dann jenes geschieht
12    Und folgendes danach
13 
14    Dann ist diese Situation eingetreten
15    Und die Daten ${xyz} befinden sich in der Datenbank
16    Und übrgens, Umlaute und Kommata in Keywords funktionieren auch
17 
18| *Test Case* | | *arg1* | *xyz* |
19| 1 | Verhalten |    123 |   234 |

Note that this even works with Umlauts and punctuation marks – in Python and in Jython. A fact, that pleasantly surprised me today 🙂

|

share post

Likes

0

//

More articles in this subject area

Discover exciting further topics and let the codecentric world inspire you.

//

Gemeinsam bessere Projekte umsetzen.

Wir helfen deinem Unternehmen.

Du stehst vor einer großen IT-Herausforderung? Wir sorgen für eine maßgeschneiderte Unterstützung. Informiere dich jetzt.

Hilf uns, noch besser zu werden.

Wir sind immer auf der Suche nach neuen Talenten. Auch für dich ist die passende Stelle dabei.