I am working in robot framework. I have two variables files in it. I want to pass these variables files dynamically. In certain condition I want to send a.py and in others b.py. But this information I want to pass dynamically. Can you please help me with this
2
votes
1 Answers
5
votes
You can use the Import library keyword to manually import an external file.
Then use the Run Keyword If keyword to check which library to import. For example:
Run Keyword If '${VAR}' == 'a' Import Library a.py
Run Keyword If '${VAR}' == 'b' Import Library b.py
You can pass the VAR as a parameter to your test:
pybot --variable VAR:a TestSuite