mrrlg Posted May 14, 2004 Share Posted May 14, 2004 I am having problems with this portion of my script as the commends I need to send all take place for the most part in the same active window. Right now, the SQL Plus window comes up, the log on window becomes active, and the script freezes at this point. I used to have the send commands separated by the sleep commands but I have too many different machines to be messing around with sleep times. Run ("C:\oracle\ora81\bin\SQLPLUSW.EXE") WinwaitActive("log on") send ("system {tab}") send ("manager {enter}") WinWaitActive("Oracle SQL*Plus") send ("@C:\SCRIPTS\INSTALL {enter}") WinWaitActive("Oracle SQL*Plus") send ("c:\SCRIPTS{enter}") WinWaitActive("Oracle SQL*Plus") send ("c:\ORACLE\ORADATA\ORCL{enter}") WinWaitActive("Oracle SQL*Plus") Link to comment Share on other sites More sharing options...
Developers Jos Posted May 14, 2004 Developers Share Posted May 14, 2004 (edited) you could try to do a WinWait and then a winactivate in stead of a winwaitactive... WinWaitActive will wait til the window gets the focus ... WinWAit wait till the window exists and then just do the Winactivate and sent the keystrokes. You could also try to do this with the control commands since they are a lot more reliable.... Edited May 14, 2004 by JdeB SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
sugi Posted May 14, 2004 Share Posted May 14, 2004 @Larry: I've got oracle 8 here, too but the AutoIt Window Spy does not detect any controls. Link to comment Share on other sites More sharing options...
emmanuel Posted May 14, 2004 Share Posted May 14, 2004 I've got Oracle 8.1.7.0.0 here, when I changed the window title to "Log On" it worked. I do see the Edit controls and suggest following Larry's advice in using them, you know, if your Spy shows them on your machines... don't you also want to have it put in the Host String? "I'm not even supposed to be here today!" -Dante (Hicks) Link to comment Share on other sites More sharing options...
mrrlg Posted May 14, 2004 Author Share Posted May 14, 2004 I am able to make the script run up to the point where the user has to type in their name and press enter, after that it doesn't seem to matter what I do, if I put in a sleep command or leave it the way it is the script crashes. If I launch the sequence manually, i.e type everything in myself, the commands run perfectly and I have connected the local database to the remote database. Running Autospy reveils nothing after the Log On window disappears. Is there a way to insert a pause after each command to see if I can find the step that crashes? Run ("C:\oracle\ora81\bin\SQLPLUSW.EXE") Winwait("Log On") send ("system{tab}") send ("manager{enter}") WinWaitActive("Oracle SQL*Plus") send ("@C:\SCRIPTS\INSTALL{enter}") WinWaitActive("Oracle SQL*Plus") send ("c:\SCRIPTS{enter}") WinWaitActive("Oracle SQL*Plus") send ("c:\ORACLE\ORADATA\ORCL{enter}") WinWaitActive("Oracle SQL*Plus") blockInput (0) Msgbox (4096, 'AutoIt', "Please Type Your First Inital and your Last Name in The Line (Please Enter the User-Name to be Added to the local Database), Then Press the Enter Key (CLICK OK TO CONTINUE)", 10) sleep(30000) blockinput (1) WinWaitActive("Oracle SQL*Plus") send ("lucy {enter}") sleep (30000) WinWaitActive("Oracle SQL*Plus") send ("exit {enter}") Sleep (10000) Exit Link to comment Share on other sites More sharing options...
Developers Jos Posted May 14, 2004 Developers Share Posted May 14, 2004 Want do you mean with "Crashes"?? you can add msgbox(4096,"debug", "test1",1) in your code ;this will popup 1 second and then continue with the next step. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
emmanuel Posted May 14, 2004 Share Posted May 14, 2004 when the error message comes up, hit Ctrl-C and then paste it in notepad... standard msgboxes will give you text that you can paste here so we can help you. "I'm not even supposed to be here today!" -Dante (Hicks) Link to comment Share on other sites More sharing options...
mrrlg Posted May 14, 2004 Author Share Posted May 14, 2004 (edited) What I mean is the script completes it's tasks, it types in Lucy and sents the exit command to close the Oracle SQL*Plus window but the local database is not created. If I do exactly the same commands manually, open the Oracle SQL*Plus window, type in system etc. it performs flawlessly. So I know all the components are there and that it must be some sort of a timing issue. Adding the message box did not generate anything useful, it just flashed Test1 on the screen for a second. Edited May 14, 2004 by mrrlg Link to comment Share on other sites More sharing options...
Developers Jos Posted May 14, 2004 Developers Share Posted May 14, 2004 (edited) i think you make a logic error wit the winwaitactive... WinWaitActive means ... wait till the screen is active... Well my guess is it is active so all your sent will be done right away.... Edited May 14, 2004 by JdeB SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now