Monday, April 9, 2012

Sikuli scripts handled When crash on Fieldworks.


Scenario : Sikuli scripts handled When crash on Fieldworks.

Explanation :
I automated, When Crash is appears on flex using sikuli script(E.g Particular scenario). Its mean, If suppose crash appears while testing on flex then screenshot and error lines are saved on appropriate file path.

E.g

import os
ERR = find("Anerrorhasoc-1.png").below(450)
ERR.click("1332009700327-1.png")
click("iewDetalIs-1.png"), sleep(5)
assertNotExist("Anerrorhasoc.png")

#def Test_D(self): # Taking screenshot in MSpaint
wait(1)
type(Key.PRINTSCREEN)
wait(1)
openApp("mspaint.exe")
wait(3)
type("v",KEY_CTRL)
type("s",KEY_CTRL), wait(0.40)
type(Key.BACKSPACE), wait(0.40)
type("Filename-1.png", "Text"), click("1332053249614.png"), wait(0.30)
closeApp("Text - Paint")
click("1333175341121.png")

#def Test_C(self): # Taking error line
dir = r"F:\Office\Script\sikulitestfiles"
fname = "Text.txt"
os.popen("start /D %s %s"%(dir,fname))
wait(5)
type("v",KEY_CTRL)
type("s",KEY_CTRL)
closeApp("Text - Notepad")



Note : Please watch below video to understand easy way.


No comments:

Post a Comment