assertExist and assert Env.getClipboard() not wroking

Asked by nitin kumar maurya

how does assertExist ("img.png") work .. during run process is shows not assertExist not define.
same problem occurs with assert Env.getClipboard()

def setUp(self):
    setAutoWaitTimeout(10)
    openApp("C:\\Windows\\system32\calc.exe") # open windows calculator
    wait("CalculatorWindow.png") # wait for calculator window to appear

def test_calculator(self):
    with Region(find("CalculatorWindow.png")):
        click("1_Button.png") # Click "1"
        click("Plus_Button.png") # Click "+"
        click("2_Button.png") # Click "2"
        click("Equals_Button.png") # Click "="
    type("c",KEY_CTRL)
    assert Env.getClipboard() == 3 # not working (assert Env.getClipboard())

def tearDown(self):
    closeApp("Calculator") # Matches text from the window's title bar

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

--- must be:
Env.getClipboard() == "3"

since Env.getClipboard() returns strings, if anything at all.

--- assertExist ("img.png")
this is deprecated.
use instead:

assert exits("img.png")

Revision history for this message
RaiMan (raimund-hocke) said :
#2

sorry for the typo :-(

assert exists("img.png")

Can you help with this problem?

Provide an answer of your own, or ask nitin kumar maurya for more information if necessary.

To post a message you must log in.