Robot - 3.1.1 Python - 3.7.3
I wanted to access method that are written in nested inner class from robot framework.
Robot:
*** S
Here is an example about how to import a class as a library and not the whole python file:
tests
there is a test.robot and an OrderList.py file.OrderList.py:
class OrderList():
pass
class Ordertable(OrderList):
def click_order(self):
print('foo')
test.robot:
*** Settings ***
Library OrderList.Ordertable
*** Test Cases ***
AA
click order
Launch it with the following command from the parent folder of the tests
folder: robot --pythonpath .\tests\ --test AA .\tests\test.robot
Result:
PS prompt> robot --pythonpath .\tests\ --test AA .\tests\test.robot
==============================================================================
Test
==============================================================================
AA | PASS |
------------------------------------------------------------------------------
Test | PASS |
1 critical test, 1 passed, 0 failed
1 test total, 1 passed, 0 failed
==============================================================================
Output: C:\Users\myuser\output.xml
Log: C:\Users\myuser\log.html
Report: C:\Users\myuser\report.html