Hi Kai,
Ok Seems I mis-understood your original question, I thought you were asking how to get TestLink to run robotframework. I’m assuming from this more recent comment you know how to do that?
So for a prerunmodifier as I understand it these are just a script that modifies/creates a .robot file and passes that dynamically generated file to RF. This is quite easy to do as a .robot file is just a structured plain text file, quite similar to a .ini file really, the structure to the file is quite well documented.
I saw that TestLink has test steps in a table similar to ALM/QC, so I’m guessing what you are wanting to do is read these steps and generate a .robot file from them? So I would suggest you start off simple (i’m referring to the screen shot below), create a very simple test case:
- In the first test step action put:
${hi}= Set Variable Hello, world!
- In the first test expected results put:
Should Be Equal ${hi} Hello, world!
- In the second test step action put:
${result}= Evaluate 2 + 3
- In the second test expected results put:
Should Be Equal As Integers ${result} 5
Then create you prerunmodifier that reads the steps from a test case and generates a mytest.robot file that looks like this (note spaces/tabs are important in robot files just like in python):
*** Test Cases ***
My Test
${hi}= Set Variable Hello, world!
Should Be Equal ${hi} Hello, world!
${result}= Evaluate 2 + 3
Should Be Equal As Integers ${result} 5
This is a pretty minimal working robot file, as all the keywords are builtin keywords so no there are no library dependancies, but if you can get TestLink to run a prerunmodifier that generates that file and run it with robot, then you’ll be well on your way.
The next step would be to add an end_test listener to catch the result and update the test execution with a pass/fail and possibly return any non empty message.
I Couldn’t tell from the documentation for TestLink if it records a pass/fail for each test step in a test execution or just simply a pass/fail for the Test Case? If TestLink if it records a pass/fail for each test step the next step would probably be to get the prerunmodifier to generate the file like this so that your listener can update the status of the individual steps:
*** Test Cases ***
My Test
Step 1
Step 2
*** Keywords ***
Step 1
${hi}= Set Variable Hello, world!
Should Be Equal ${hi} Hello, world!
Step 2
${result}= Evaluate 2 + 3
Should Be Equal As Integers ${result} 5
I hope this is helpfull,
Dave.