← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #665137]: Object orientation in Python scripts

 

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

    Status: Answered => Open

CCIOLA is still having a problem:
Hi @RaiMan,

Here is the thing: I need to test a complex desktop application that
runs in Delphi and the only way to automate this test is using SikuliX.
Other softwares, like Winium, did not work for me.

I will have to use OO to separete the alternative fluxes of this
application in classes (a bunch!), calling the methods when needed.

I've been looking on many websites and reunited on this script what I
thought it would be the closest way to do this.

Comments with ">>":

--- main.py
import shutil
#from geraCPF import geraCPF
import geraCPF # just so >> if I do this, it does not work for me.

#class main(): # does not makes sense and the implementation is not
Python-like >> ok.

myApp = App("Chrome")
App.open("C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe")
myApp.focus()
while not exists("1520001990649.png"):
   observe() # not sure, what this should do??? >> it's an implicit wait: while the image.png does not appear, SikuliX just 'observe' and keep running without doing nothing.
   wait(1)
click("1520001996809.png")
type(geraCPF.cpf_funcional_func()) # the function returns str() anyway >> ok.
# you have to say module.function() >> not sure if it will work, I'll try.
wait(1)
#exit() # not needed >> I have to exit from the script execution and return to SikuliX.

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