Pushkala Posted August 7, 2012 Share Posted August 7, 2012 Hi, I have a certain AUTOIT script exe in my test automation . It seems to run fine if I run it on my test machines - but it encounters AutoIT Error pop -up when run from Hudson (on the same machine). Was wondering if I can redirect the runtime error to a log file. Any pointers -- Pst pst - a AUTOIT beginner here Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted August 7, 2012 Moderators Share Posted August 7, 2012 Hi, Pushkala, welcome to the forum. Probably the best thing you can do is post your script in its entirety, as well as a screenshot of the error you are receiving. This will go a long way to helping us help you. Otherwise we're just shooting in the dark "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Pushkala Posted August 7, 2012 Author Share Posted August 7, 2012 Ok- Here goes the code. Let me elaborate the scenario! 1) Selenium initates a click operation on a certain link 2) In File Download pop up comes up (Firefox Save or Open Dialog - autoIT driven) select Save 3) Select file to save to.. opens up -- provide path (autoIT driven) Now if I run my tests from command prompt directly on the test machine - i see no errors of any kinds. But from my automation system (where i cannot visually see AutoIt in action) I see via logs that it has encountered autoIT error window between step 2 and step 3. I basically want to catch the runtime AutoIT error message in logs. expandcollapse popup$title="Opening myfile.zip" If WinExists($title)=1 Then WinActivate($title) LogMessage('Window "' & $title & '" found by WinActivate.') ;MsgBox(0,"","Tab1") Send("{DOWN}") LogMessage('Window "' & $title & '" Hitting DOWN.') Send("{TAB}") LogMessage('Window "' & $title & '" Hitting Tab.') ;MsgBox(0,"","Tab1") ;MsgBox(0,"","Dpwm") Send("{TAB}") LogMessage('Window "' & $title & '" Hitting tab.') Send("{TAB}") LogMessage('Window "' & $title & '" Hitting tabb.') Send("{ENTER}") If WinExists("[CLASS:#32770;]", "")=1 Then $title1 = WinGetTitle("[CLASS:#32770;]", "") LogMessage2('Window "' & $title1 & '" found by WinExists.') $title="Enter name of file to save to…"; For $i = 0 To 10 If WinExists("Enter name of file to save to…")=1 Then WinActivate($title) WinWaitActive($title LogMessage2('Window "' & $title & '" found by WinActivate.') ControlSetText($title,"","ToolbarWindow323","Address: C:sw") LogMessage2('Window "' & $title & '" found sending Edit1 ') ControlSend($title,"","Edit1","C:myfile.zip") ControlFocus($title,"","Button1") LogMessage2('Window "' & $title & '" focus on Button1') ControlFocus($title,"","Button1") ControlFocus($title,"","Button1") ControlClick($title,"","Button1") $i=11 Exit Else LogMessage2('Window "' & $title & '" NOT found by WinActivate.') Sleep(60000) ContinueLoop EndIf Next EndIf Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted August 7, 2012 Moderators Share Posted August 7, 2012 Well, from how you have it posted, I see a couple of errors. Are you copying and pasting from AutoIt, and do these errors exist in your script? I see: Line 25 missing closing ) WinWaitActive($title Very last line in script, missing EndIf "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Pushkala Posted August 7, 2012 Author Share Posted August 7, 2012 Copy paste error .. 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