sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #50161
[Question #677916]: Script Exception after region highlight
New question #677916 on Sikuli:
https://answers.launchpad.net/sikuli/+question/677916
Hello all,
With the script below (a part of a much longer script), after "vncReg.highlight(2)" I have this error:
[error] Error caused by: Traceback (most recent call last): File "c:\TEstBug.sikuli\TEstBug.py", line 21, in <module> vncReg.highlight(2) AttributeError: 'org.sikuli.script.Region' object has no attribute '__exit__'
That I had not with previous versions of Sikulix.
This happens with running inside the IDE and from Pycharm, no differences in error messages
How could I fix this error?
My environment is :
1.1.4-SNAPSHOT-2019-01-16_07:30/Windows10.0/Java8(64)1.8.0_191-b12
Thanks in advance
This is the minimum script to show the error, the images are the connection button and the refresh button of the ultravnc window, line 21 mentioned in the error message is "vncReg.highlight(2)"
# !/usr/bin/env python
# -*- coding: utf-8 -*-
import org.sikuli.script.SikulixForJython
from sikuli import *
appVNC= App(r'"c:\UltraVNC\vncviewer.exe"')
appVNC.open(0)
print appVNC
if not(appVNC.isRunning(5)):
exit(-1)
appVNC.focus()
vncReg=Region(appVNC.window())
with Region(vncReg):
click("1544628503735-1.png")
wait(2)
vncReg=appVNC.focusedWindow()
vncReg.highlight(2)
with vncReg:
click("1544788207679.png")
and this is the full console output:
[-1:vncviewer (???)] c:\UltraVNC\vncviewer.exe
[log] CLICK on L[1104,399]@S(0) (534 msec)
[log] highlight R[781,438 357x123]@S(0) for 2.0 secs
[error] script [ TEstBug ] stopped with error at line --unknown--
[error] Error caused by: Traceback (most recent call last): File "C:\Projects\DataPurchase\REACT\SikuliX\Test_h20\TEstBug.sikuli\TEstBug.py", line 20, in <module> vncReg.highlight(2) AttributeError: 'org.sikuli.script.Region' object has no attribute '__exit__'
--
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.