VNC - problem finding an image
I've problem finding an image/clicking on it.
After the connection I capture the VNC screen and the image contain the image.
The problem is in first click: scr.click(
Below my script
-------
import shutil
#######
screenType = 0 # 1 = screen(0), 2 = vnc screen
#######
scr = object()
def vncConnection(scr):
try:
except:
print(" " , sys.exc_info()[1])
print(" " , sys.exc_info()[2])
return None
if not scr:
print "no connection"
return None
wait(3)
return scr
items =("Nothing selected","VNC Screen","Your PC screen")
selected = select("Please select from list the type of screen", options = items)
if selected == None: # Esc button
exit(-1)
if selected == items[0]:
popup("No selection")
exit(-2)
if selected == items[1]:
screenType = 1;
if selected == items[2]:
screenType = 2;
if screenType == 1:
scr = vncConnection(scr)
if scr == None:
exit(-1)
if screenType == 2:
scr = Screen(0)
#######
Settings.UserLogs = True #(False: user log calls are ignored)
Settings.
Settings.
b=getBundleFolder()
Debug.setUserLo
imagePath = b+'savedImages\\'
sPath=capture(scr)
print("sPath=" +sPath)
newImage = os.path.
print("imagePath=" + imagePath + " newImage=" + newImage)
shutil.move(sPath, newImage)
scr.click(
while not scr.exists(
src.sleep(1)
scr.click(
scr.type ("notepad")
while not scr.exists(
src.sleep(1)
scr.click(
while not scr.exists(
src.sleep(1)
scr.type('n', Key.CTRL)
while not scr.exists(
src.sleep(1)
scr.type(Key.ENTER)
scr.type ('Hello , nice to be here' + Key.ENTER)
a = scr.find(
print a
if screenType == 1:
scr.stop()
use()
#######
exit(0)
-------
exception
CConnection: Server supports RFB protocol version 3.8
CConnection: Using RFB protocol version 3.8
sPath=C:
imagePath=
[error] script [ vnc ] stopped with error at line --unknown--
[error] Error caused by: Traceback (most recent call last): File "C:\sviluppo\
at org.sikuli.
at org.sikuli.
at org.sikuli.
at org.sikuli.
at org.sikuli.
at org.sikuli.
at sun.reflect.
at sun.reflect.
at sun.reflect.
at java.lang.
org.sikuli.
ava
-------
- Window 7 64 bit SP1
- UltraVnc: VNC server version 1.2.1.1
- Siculix 1.1.4-SNAPSHOT-
-------
Thank you in advance.
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- Sikuli Edit question
- Assignee:
- No assignee Edit question
- Last query:
- 2018-12-04
- Last reply:
- 2018-12-04
RaiMan (raimund-hocke) said : | #1 |
Did you already check, wether the offending image can be found in the shot you stored before?
maria beatrice martini (mbmar) said : | #2 |
Yes, "1541417310503.png" is present in the shot. The script works fine if you select "Your pc screen", it doesn't work with "VCN Screen".
Please let me know, if you need the shot and the image. I can't attach them here.
RaiMan (raimund-hocke) said : | #3 |
The vnc-shot, local-shot and the image would help.
mail: sikulix-
Can you help with this problem?
Provide an answer of your own, or ask maria beatrice martini for more information if necessary.