Sign in to follow this  
Followers 0
mrrlg

If Only I Could Send

9 posts in this topic

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")

Share this post


Link to post
Share on other sites



#2 ·  Posted (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 by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

@Larry: I've got oracle 8 here, too but the AutoIt Window Spy does not detect any controls.

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
Share on other sites

#8 ·  Posted (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 by mrrlg

Share this post


Link to post
Share on other sites

#9 ·  Posted (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 by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0