1

I have the following requirement

1) Robot test call a .py file which will dynamically load new modules based on strings. The Python script will have the object for the new module

2) I want to pass the object of the new module back to Robot. I need this as the Tester can then tweak some parameters of the module for a sub test case.

I have figured out the first part but am finding difficulty in the second part. Here is a part of the code that I have written along with some outputs

From Robot file

### this will return the object of the new module. SnpSuper in my case
${var} =        my_code.Snp Configure Router     ${dict}  
Log     ${var}

### Here I would like to call another method of the new module. 
${var1} =       Call method     ${var}      Linux_Super_Configure    ${dict} 

Output of the Robot file

===========================

00:46:19.548    FAIL    Object module 'SnpSuper' from '/homes/New/TrialCode/SnpSuper.py does not have method 'Linux_Super_Configure'.   

Thanks.

Bryan Oakley
  • 370,779
  • 53
  • 539
  • 685
user2905950
  • 41
  • 1
  • 1
  • 4
  • 2
    This question already been answered twice. http://stackoverflow.com/questions/7580252/return-results-in-robot-framework-keyword http://stackoverflow.com/questions/40238073/how-to-pass-objects-to-keywords-in-robot-framework – farhan May 04 '17 at 19:37
  • The error seems pretty self-explanatory. You're doing everything right in your robot file, assuming that `my_code.Snp Configure Router` actually returns the object that you think it does. – Bryan Oakley May 04 '17 at 22:28
  • Possible duplicate of [Return results in Robot Framework keyword?](http://stackoverflow.com/questions/7580252/return-results-in-robot-framework-keyword) – Laurent Bristiel May 05 '17 at 08:36

0 Answers0