RobotFramework: problems with python classes

Asked by venkatesh on 2017-09-13

getting key error :

I have 3 python classes regionDictionary.py , Test2.py , Test3.py

regionDictionary.py - contains different region dictionaries added like below

 self.addReg("normalScreen",Region(0,0,screenWidth,screenHeight))

and getter and setter method to retrieve the dictionary value

def addReg(self, name, reg):
  self.regDict[name] = reg

 def getReg(self, name):
  return self.regDict[name]

Test2.py - contains

reg = regionDictionary(1920,1080)
self.reg.getReg("normalScreen")

Test3.py i have the test cases and i ran using below suggested framework

I ran my code using (http://blog.mykhailo.com/2011/02/how-to-sikuli-and-robot-framework.html) Robot Framework

 C:\work\> jybottest.bat robot_suite\verify_operations.txt

im getting error as KeyError: 'normalScreen' in log.html

can you please help me in resolving this

when i run through jybot.test the dictionaries of the parent class will not be loaded ?

Question information

Language:
English Edit question
Status:
Solved
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Solved by:
venkatesh
Solved:
2017-09-14
Last query:
2017-09-14
Last reply:
2017-09-14
RaiMan (raimund-hocke) said : #1

reg = regionDictionary(1920,1080)

In your code I cannot see an init method that initializes the reg object with the given values and the key "normalScreen".

venkatesh (venkat6840) said : #2

Hi Raiman,

Mistake is from my side , i just now saw there are two regionDictionary.py classes one in

1) Folder/Folder which contains 'normalScreen' dictionary
2) Folder which doesn't contains 'normalScreen' dictionary

The code im running is from Folder /folder and my code is taking from Folder - regionDictionary.py thats where it is throwing the error

Thanks for you reply