← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #637765]: Sikuli Framework - Issue in using switch statement to perform the actions from different .py file

 

Question #637765 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/637765

Description changed to:
Hi All,

I have been trying to create an automation framework for Sikuli X-1.Orc3
IDE for my project.  Here is my flow..

1. To read data from CSV file
2. Extract the image from the image dictionary
3. With help Keyword extracted from CSV file and Image from the dictionary perform actions in the screen.

Code:

InputRead.sikuli --> Inputread.py
##############################
import csv
import os
from ImageDictionary import TestImgDict
from Actions import Actions

def readcsvfile():
            try : 
                   mypath = os.path.dirname(getBundlePath())
                   obj1 = Actions()
                   input = open(<CSV path>, 'rb')
                   for line in input.readlines():
                        Field,Keyword,value = line.strip().split('",")
                        print Field,Keyword,value
                        Runresult = obj1.Actions(Field,keyword,value)
                        print Runresult

            except IOError:
                        Print "Input File not Found"
readcsvfile()

ImageDictionary.sikuli --> ImageDictionary.py
################################
Class TestImgDict(object):
            ImgDict = {}

            def __init__(self)
                        self.imgDict = {}
                        self.addImage("LoginName_Txtbox",<Image.png>)

            def getImage(self, name, img):
                        return self.imgDict[name] 

Actions.sikuli --> Actions.py
##########################
from ImageDictionary import TestImgDict
import ConfigParser

Class Actions(object):
         def __init__(self):
                  config = ConfigParser.ConfigParser()
                  config.read(<path>)

         def Actions(Field,keyword,value):
                  obj = TestImgDict()
                  return {
                           'Type' : type(obj.getImage(Field),value)
                               }.get(keyword, 'NoValue')

##############################
Error message: 
Type Error : Actions() takes exactly 3 arugment (4 given).

I know missed something in the code.. I have been trying to find the
root cause.

Please help.. Please guide me..

Thanks

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.