New question #270350 on Sikuli:
https://answers.launchpad.net/sikuli/+question/270350
Hello,
I am new to Sikuli and am still struggling to fully understand the depths of
the commands.
I am trying to create a script that tests the display of a CAD program when
viewing a CAD 3D model, by pressing the " top" ,"isometric" , " fit to screen "
, " front " views buttons .
I am comparing for the same sample model. Therefore, I have made screenshots of
the desired views and am comparing them to the screenshots automatically taken
by Sikuli . I am using Region On Vanish function to issue a warning in case
pressing one of the views buttons does not result in the desired view.
The problem is that the screenshot that is taken by the region to compare with
my images is taken before pressing each of the buttons . In the first two
buttons , I don't get a warning , because the image is the same before and
after pressing each of the fit and isometric buttons . But after I press " Top
" , the region takes a screenshot of before the click and compares it with the
image of the top view . Therefore I get a warning . This repeats for the next
buttons .
I find Sikuli a very interesing and useful tool and would really want to
understand this issue to get over to the next level with it :)
My code is the following :
App.open('the CAD software')
click("open icon")
type(Region(1517,369,121,12),'path to file')
click(Region(1568,791,96,15))
type('cad file') #click on
the region to write the path to the model's file and then type the file's name
click("Open.png")
click("1439209406111.png") #open and load the model
def warning(event):
switchApp("C:\\Program Files (x86)\\Sikuli X\Sikuli-IDE.exe")
print("warning")
stopObserver()
wait(7)
click("Fit.png")
wait(3)
with Region(Region(275,167,1031,791)):
onVanish("1439365790828.png",warning) #if the
desired image is not found in the region, issue a warning
observe(3)
stopObserver()
wait(3)
click("lsometric.png")
wait(3)
with Region(Region(275,167,1031,791)):
wait(3)
onVanish("1439365790828.png",warning)
observe(3)
stopObserver()
wait(3) #the same . in these first two
instances , I don't get a warning , as I explained in the beginning of my post
click("Top.png")
with Region(Region(276,166,1220,795)):
onVanish("1439365822091.png",warning)
observe(3)
stopObserver()
wait(3) #here I get
a warning , because the screenshot that the region takes and compares it to
my
image is before clicking on the top button, even though the command to click on
the
button comes before the region selector.
with Region(Region(276,166,1220,795)):
click("Front.png")
wait(3)
onVanish("front desired view",warning)
observe(3)
stopObserver() #same issue here.
wait(5)
click("exit.png")
I tried to include the next region capture in the previous region actions (
with TAB ) , but this didn't work too. I tried introducing another event ,
another intermediary region defined-action ,delays , etc , but nothing seemed
to work .
--
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.
_______________________________________________
Mailing list: https://launchpad.net/~sikuli-driver
Post to : [email protected]
Unsubscribe : https://launchpad.net/~sikuli-driver
More help : https://help.launchpad.net/ListHelp