Sign in to follow this  
Followers 0
Pushkala

Runtime AUTOIT errors

5 posts in this topic

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

Share this post


Link to post
Share on other sites



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


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

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.

$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

Share this post


Link to post
Share on other sites

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


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

Copy paste error ..

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