lundi 4 avril 2016

Where and how to create own functions in Eggplant and make them call

I want to write one function in Eggplant since I am also new to eggplant

Where I should write my function in a separate script or the same script ?

This is my function

function findText textToFind
    put TextToFind into searchString
    repeat while not imageFound(0,text:searchString)
        put TextToFind into searchString
        do "replace the" && ordinalWords(repeatIndex()) && "space in searchString with return"
        if repeatIndex() equals the number of words in textToFind then
            logError "String:" && textToFind && "was not found"
            exit all
        end if
    end repeat
    return foundImageLocation()
end findText

How should I call the function in my script

Aucun commentaire:

Enregistrer un commentaire