sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #02991
[Question #159564]: Neither type nor paste works for Java app
New question #159564 on Sikuli:
https://answers.launchpad.net/sikuli/+question/159564
I am using Sikuli X-1.0rc2 on Windows Win7 SR1 64 bit
I have two problems:
1. App.open fails. Cannot figure out why launching app using fully qualified path name fails. I can successfully launch Windows accessories programs without any explicit path (using WINDOWS PATH variable). What could I be doing wrong?
2. Cannot get input for login of id/pwd to be directed to the java application logon window. I have tried both "type" and "paste" operations. If I manually enter from keyboard or manually use paste buffer (without using Sikuli), the java app works fine. All the other windows detection checks find and select the window as expected. Is there something special about native java apps that I'm missing for redirecting input to the text field?
Appreciate your expert help!
I've attached both my source code as well as the diagnostic log.
fullNameOfApp = "c:\\ThinkTDA\\ThinkTDA.exe"
# tosApp = App.open(fullNameofApp) # would like this to work but it doesn't
# if tosApp == 0:
# popup("launch of ThinkTDA failed")
# exit(1)
# UGH, so let's alternatively launch the java app using a command prompt window
cmdApp = App.open("cmd.exe") # launch command prompt window
while not cmdApp.window(): # no cmd window visible yet
wait(1)
while not cmdApp.focus(): # force input focus to cmd prompt window
wait(1)
# launch java-based application
if not type(fullNameOfApp + "\n"):
popup("launch of ThinkTDA failed")
exit(1)
popup("launch of ThinkTDA succeeded")
while not cmdApp.focus(): # force input focus to cmd prompt window
wait(1)
if not type("exit\n"): # close cmd prompt window
popup("close of cmd failed")
exit(1)
tosApp = 0
while (tosApp == 0):
wait(1)
tosApp = App("Logon") # find login window of java app
while not tosApp.window(): # bring java app window to the front
wait(1)
while not tosApp.focus(): # force input focus on java app window
wait(1)
click( ) # force click in text field
if not type("login_ID"): # this does not enter data into the field
popup("type failed")
exit
if not paste("login_ID\tpassword\t\t\n"): # this does not enter data into the field
popup("paste of login/pwd failed")
exit
popup("end of program")
log file:
[log] App.open cmd.exe(3780)
[debug] getWindow: null
[debug] getWindow: java.awt.Rectangle[x=30,y=30,width=843,height=949]
[log] App.focus cmd.exe(3780) #0
[log] TYPE "c:\ThinkTDA\ThinkTDA.exe "
[log] App.focus cmd.exe(3780) #0
[log] TYPE "exit "
[debug] getWindow: null
[debug] getWindow: java.awt.Rectangle[x=598,y=256,width=484,height=537]
[log] App.focus Logon(0) #0
[log] CLICK on (797,638)
[debug] showTarget 757 598 80 80
[log] TYPE "login_ID"
--
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.