Jump to content

magodiez

Active Members
  • Posts

    24
  • Joined

  • Last visited

Everything posted by magodiez

  1. Ok, I'm not really convinced, but I'll give you the benefit of the doubth... If you want to work with google maps, there is a great Google Maps API that you can use... I've used it in javascript and is not too complicated...
  2. You said: What else do you need?
  3. use the Window Info tool to check the Button information, and do something like: Global $dir="/SubmitEaze/",$SubmitEaze_exe="SubmitEaze.exe" If Not ProcessExists($SubmitEaze_exe) Then ShellExecute(@ProgramFilesDir & $dir & $SubmitEaze_exe,"","","",@SW_SHOWNORMAL) EndIf WinWaitActive("User Account Control","Do you want to allow") ControlClick("User Account Control","Do you want to allow","Button1")
  4. You should read the Forum Rules and you'll understand why you won't get any help and this thread will shortly be locked
  5. Don't ask for code, ask for help... you might use WinWaitActive to wait for the window to be active and then click. You should use ControlClick instead of MouseClick...
  6. That's why I told you to sleep (6 hours - execution time), this way you don't need to be checking... no matters the execution time, you can wait the exact time: $timeStart = TimerInit() yourFunction() sleep(21600000 - Round(TimerDiff($timeStart))) ;sleep (6 hours - execution time) Have you tried to do it with the Windows Task Scheduler??? May be a better solution to your problem...
  7. That's my point, if you only need a cycle every 6 hours, why don't you simply sleep for 6 hours (- execution time) after executing the cycle, so the script isn't checking the time in your computer every 50 seconds??? and if you really need to check it during the last hour, why 50 seconds and not 60??? Just trying to optimize it for you...
  8. why are you doing this??? $i=$i is completely useless... XD
  9. you miss a 0 in the 5 hours sleep(18000000) why are you sleeping 5 hours if you need 6 hours?? why don't do something like while 1 If (@HOUR="19" Or @HOUR="01" Or @HOUR="07" Or @HOUR="13") And @MIN="00" then $timeStart = TimerInit() yourFunction() sleep(21600000 - Round(TimerDiff($timeStart))) ;sleep 6 hours - execution time ;you don't need the else EndIf WEnd Func yourFunction() ... ... EndFunc
  10. is the computer/server using the IP 192.168.1.107 connected???
  11. that code works fine in my computer... Do you get any error???
  12. $CmdLine[0] is number of parameters (for more info http://www.autoitscript.com/autoit3/docs/intro/running.htm#CommandLine) to work with Directories add the flag 1 to overwrite DirMove($CmdLine[$A], $destination,1) and you can also add the flag 8 for files, in case the destination folder is not created FileMove($CmdLine[$A], $destination,8) $destination = "D:\Test" If $CmdLine[0] Then For $A = 1 To $CmdLine[0] If StringInStr(FileGetAttrib($CmdLine[$A]), "D") Then ; Is a Folder/Directory DirMove($CmdLine[$A], $destination,1) Else ; Otherwise it must be a file. FileMove($CmdLine[$A], $destination,8) EndIf Next EndIf
  13. Sorry, I don't know what I've readed... X( you can have directly the information in the stdout or stderr... #include <Constants.au3> $pid = Run("C:\Program Files\Java\jre6\bin\java.exe -classpath C:\temp\myjar.jar", "", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) ProcessWait($pid) MsgBox(0x0,"",StdoutRead($pid)) MsgBox(0x0,"",StderrRead($pid)) Note: You can then put them in a file if you need it, but there is probably a better way to do this...
  14. what about: $output = RunWait("C:\Program Files\Java\jre6\bin\java.exe -classpath C:\temp\myjar.jar 1>C:\temp\log_file.log", "",@SW_HIDE) MsgBox(0x0,"Output",$output)
  15. you can do it with a batch: move "%1*.*" D:Test or in Autoit: $destination = "D:Test" If($CmdLine[0] > 0) Then FileMove ( $CmdLine[1], $destination) Else MsgBox(0x10,"Error!",$CmdLine[0] & " arguments passed!") EndIf Note: This only would move the files in the folder, but no sub-folders
  16. check the function reference: http://www.autoitscript.com/autoit3/docs/functions/FileMove.htm I'm not sure what you are trying to do, but you can use wildcards or put it in a loop to do it with different source directory
  17. you can try something like: (untested) Global $pixel = 5921370 Global $pixel2 = 3773968 Global $pixel3 = 7671057 ;other code here While True If PixelGetColor(820,524) = $pixel2 Then MouseClick("left",820,524,1) If PixelGetColor(820,524) = $pixel3 Then MouseClick("left",697,652,1) If PixelGetColor(482,144) = $pixel Then ContinueLoop EndIf EndIf Endif ;other code here Wend or Global $pixel = 5921370 Global $pixel2 = 3773968 Global $pixel3 = 7671057 $found = False While True If ($found = False) Then ;other code here EndIf $found = False If PixelGetColor(820,524) = $pixel2 Then MouseClick("left",820,524,1) If PixelGetColor(820,524) = $pixel3 Then MouseClick("left",697,652,1) If PixelGetColor(482,144) = $pixel Then $found = True EndIf EndIf Endif Wend
  18. Probably you should wait to be sure you get some data... what about something like this? ; Start The UDP Services ;============================================== UDPStartup() ; Register the cleanup function. OnAutoItExitRegister("Cleanup") ; Bind to a SOCKET ;============================================== $socket = UDPBind("127.0.0.1", 65532) If @error <> 0 Then Exit While 1 $data="" $data = UDPRecv($socket, 50) If $data <> "" Then ;wait until we get some data ;my software send as "3" and it apears as this... If $data <> "0x696E74002C69000000000003" Then ExitLoop ;if not expected data exit EndIf EndIf sleep(1000) WEnd MsgBox("error","",1) Func Cleanup() UDPCloseSocket($socket) UDPShutdown() EndFunc
  19. I think you are trying to do something like: mp4box.exe -hint filename1 mp4box.exe -hint filename2 mp4box.exe -hint filename3 In this case, you should use a loop to execute the command multiple times, something like: $message = "Hold down Ctrl or Shift to choose multiple files." $var = FileOpenDialog($message, @WindowsDir & "\", "Videos (*.mp4;*.m4v;*)", 1 + 4 ) If @error Then MsgBox(0x1000,"","No File(s) chosen") Else $files = StringSplit($var, "|") For $i=2 To $files[0] $filename = $files[1] & "\" & $files[$i] ;files[1] contains the folder path Run("mp4box.exe -hint " & $filename) Next EndIf
  20. Hello, I'm trying to automate some tests from an tool developed in my enterprise. I'm still not able to interact with the GUI in other way than by keyboard (TAB, ALT, etc.) an I would like to interact by doing something like ControlClick or selecting a menu/combo , etc. The applications have a GUI developed one in Java an the other in the C++ library "IBM ILOG Views". So my question is: Is there a way to use the functions with ControlID with this kind of GUI? And how can I get this ControlID? I've already tried with the text or ID, but still no result. Obviously I'd prefer not to use coordinates. Is there any way to detect the text in these windows in order to check if the actions result is correct, in case I do it totally by keyboard? Thanks,
  21. Doesn't work, I'm not sure I can find a ControlID or text for the buttons. I've also tried this to find the ControlID with ControlGetFocus, and it returns nothing, and no error WinActivate("[CLASS:IlogViewsWndClass]") ConsoleWrite(ControlGetFocus("[CLASS:IlogViewsWndClass]")) If @error = 1 Then ConsoleWrite("error") EndIf
  22. Hello, Trying to test an internal aplication, I'm not able to find what it is the ControlID of any of the Controls into the aplication window with the "Window Info" aplication. I've tried some scripts too, trying to return the text with [iD:XXXX] (tried to find the text with a for, from 0 to 100000), [TEXT,"Exit"] and even some scripts found in the forum, but I can't find any Control. Local $text = "" WinActivate("[CLASS:IlogViewsWndClass]") $text = ControlGetText("[CLASS:IlogViewsWndClass]",'', "[TEXT:'Exit']") If(@error <> 1) Then ConsoleWrite(">" & $text & @CRLF) EndIf For $i=1 To 100000 $text = ControlGetText("[CLASS:IlogViewsWndClass]",'', "[ID:" & $i & "]") If(@error <> 1) Then ConsoleWrite(">" & $text & @CRLF) EndIf Next Is there any other way to interact with the button/combo/textfields/menu to click/select/type them (without x,y coordinates) or I'm forced to do it by keyboard with the TAB, !, etc.? And if I only can do it by keyboard, is there any way of knowing the state or text of the different Controls ( Obviously without the ControlId)? Thank,
  23. Thanks, I'll look the threads. I'm testing this "driver" I just found, http://blueducksda.sourceforge.net It could be pretty useful, at least some of the options. Time to go home, I'll continue tomorrow. Have a nice day,
  24. Hello, I'm working as a tester and I used to use Selenium to test web based applications. Now I have to test a desktop application so I can't use Selenium any more, and searching for new tools I found AutoIt really interesting and useful. I only wonder If I can use it for testing an application (so It's not sure that is going to work) and get some kind of results to know if the tests were OK or which ones have failed (similar to Selenium). In the other hand I want to assure that it's possible to run the script from an external application or command line, I've already seen some topics so I almost sure it's possible. Thanks for the replies and I'll appreciate some ideas about the first question,
×
×
  • Create New...