I am very new to robot framework. I am trying to create object of a python class from Robot framework. The following is the python code:
class sample():
def __init__(self,dict1,connect=True):
self.device=dict1['device']
self.ip=dict1['ip']
self.uname=dict1['uname']
self.password=dict1['password']
self.dict1={'device':self.device,'ip':self.ip,'uname':self.uname,password:self.password}
self.is_connect=False
self.is_config_mode=False
if connect:
self.connects_to()
def connect_to(self):
print('stuff')
I need to make an object of the class sample in Robot file and use it to call other subsequent methods. What I did is:
*** Settings ***
Documentation Testing connection
Library Collections
Library RequestsLibrary
Library sample.sample ${dict1} WITH NAME obj
Variables
*** Keywords ***
Test_Connection ${name}
[Documentation] Testing connection
${a}= obj.connect_ssh
I am getting the following error:
Test Library 'sample' expected 1 to 2 arguments, got 0.
Kindly help. Thanks.