← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #240935]: Large Test Batch (3000 test cases) gradually slows down in execution

 

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

    Status: Needs information => Open

Nathan Ash-Vie gave more information on the question:
This is how I extract the data from the CSV file:

    xReader = file("G:\\UW Manual\\EDI Development\\Test Batches\\i90
Rates Bulk Test Pack - CDN.csv")

    for line in xReader:
        Val = line.strip().split(",")

The loop contains around 700 lines of automation but 99% of it is simply
using the paste function for the current CSV cell value. For instance:

            paste(Val[3]) #Policyholder Name
            type(Key.TAB)
            
            paste(Val[5]) #Title
            type(Key.TAB)
                
            paste(Val[6]) #Marital
            type(Key.TAB)
            
            paste(Val[7]) #Gender
            type(Key.TAB)
            type(Key.TAB)
            type(Key.TAB)
            type(Key.TAB)

Every now and again there is some data formatting (for instance
converting US date formats into EU data formats e.g. MM/DD/YY into
DD/MM/YY).

There is a lot of image recognition, for instance there are 26 waits
which ensure the script does not begin entering information before the
screen has fully transitioned:

            wait("1386751004792.png",10)

To capture results I write to text files:

        if not os.path.exists(ResultsDir):
            os.makedirs(ResultsDir)

        #Capture results
        ResultsFile = open(ResultsDir + "\Test " + str(testCount) + ".txt", "w")
        ResultsFile.write(Results.encode('latin-1'))
        ResultsFile.close()
        Results = ""

I've not modularised or separated the code into functions/subs. This is
the first time I've used the Jython. Is it fully OO e.g. class
hiearchies, interfaces and inheritance or can you simply create
subs/functions and have the script run procedurally?

Thanks,

Nathan

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.