Jump to content

coolooc

Active Members
  • Posts

    22
  • Joined

  • Last visited

coolooc's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Hi, I need some help I am trying to using: #Include <Chrome.au3> in order to clicking on button from HTML page by id (id="open-job-dialog-button") in Chrome browser. In Internet explorer its work with the code: $oBtn = _IEGetObjById($oIE,$IdButton) _IEAction($oBtn, "click") The code I write is: #Include <Chrome.au3> local $oBtn2 =_ChromeObjGetHTMLById("open-job-dialog-button") If @error then msgbox(0,"error to get the object by html id",$obtn2) Else msgbox(0,"sucess to get the object by html id",$oBtn2) EndIf I am getting a message with: {"text";"error"} that mean the variable $obtn2 include error value replace to getting some object. In addition I search some function to clcik on the object I suppose to click on Chrome. Please if someone know or worked with this and can help ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- #Include <Chrome.au3> include this relavant code: Func _ChromeObjGetHTMLById($objid, $timeout = 5) dim $response = "" $response = _ChromeEval("document.getElementById('" & $objid & "').innerHTML;", $timeout) return $response EndFunc Func _ChromeEval($javascript_expression, $timeout = 5) Dim $response = "" if WinExists("[REGEXPTITLE:.*- Google Chrome]") Then FileDelete($chrome_native_messaging_host_dir & "input.txt") FileWrite($chrome_native_messaging_host_dir & "input.txt", $javascript_expression) $begin = TimerInit() While TimerDiff($begin) < ($timeout * 1000) If FileExists($chrome_native_messaging_host_dir & "output.txt") then ExitLoop sleep(100) WEnd If FileExists($chrome_native_messaging_host_dir & "output.txt") then $response = FileRead($chrome_native_messaging_host_dir & "output.txt") FileDelete($chrome_native_messaging_host_dir & "output.txt") Else SetError(2) EndIf Else SetError(1) EndIf Return $response EndFunc
  2. Hi, Actually I dont hav experience in AutoIt. I try what you say and also "controlclick" function and also not getting the right results. Can you give me the lines I suppose to write in order to click this specefic button (by the HTML code I added)? In addition I need it work also with Chrome and FireFox.
  3. Part from the HTML code: ....... <div id="main-container"> <div id="mainViewMessages"></div> <header id="toolbar"> <img id="logo-img" src="images/01_Logo_temp.png" alt="logo" title="IDB graphic viewer logo" /> <!-- <img id="logo-img" src="images/coolStyleTopLogoFrontline.png" alt="logo" title="IDB viewer logo" /> --> <h1 id="title">&lt;Job Name&gt;</h1> <div class="tool-button tool-button-36" title="Open Job" id="open-job-dialog-button"></div> ...... We have some new program we build in the web in the HTML we create some button id="open-job-dialog-button" I create a test in autoit and want to click on this id button (by the id and not by mouseclck with the positions). I am trying controlclick but failed. Can you give me some function that with this?
  4. I mentioned it in the first message. I tried to include all the files in the main file, and it worked first, but for some reason after some additions and changes in the code i got error "undefined function". include all the files in the main file may not be the reason, but changing it to #include-once helped. Thank you!
  5. Oh in the file... sorry. Thanks!
  6. I got "syntax error" for writing: #include-once "general_func.au3"
  7. Hi, I'm using functions from one file in two different files, so i include this file in both of them. I run the functions in those files from another file, so i include both of them in that file. Example:Files- file_general_func, file1, file2, file_main. file1: #include "file_general_func" file2: #include "file_general_func" file_main: #include "file1", #include "file2" After build this script i gets "WARNING: already included file:" Removing the #include "file_general_func" from both files and include it only in "file_main" worked for a while, but after some changes I got error or "undefined function" How can i solve it? Thanks, Shany
  8. #region ---Au3Recorder generated code Start (v3.3.7.0) --- #region --- Internal functions Au3Recorder Start --- Func _Au3RecordSetup() Opt('WinWaitDelay',100) Opt('WinDetectHiddenText',1) Opt('MouseCoordMode',0) EndFunc Func _WinWaitActivate($title,$text,$timeout=0) WinWait($title,$text,$timeout) If Not WinActive($title,$text) Then WinActivate($title,$text) WinWaitActive($title,$text,$timeout) EndFunc AU3RecordSetup() #endregion --- Internal functions Au3Recorder End --- _WinWaitActivate("C:UsersshanyDesktopaaa.au3 * SciTE","") Send("{LWINDOWN}{LWINUP}") _WinWaitActivate("Start menu","") Send("notepad{ENTER}") #endregion --- Au3Recorder generated code End ---
  9. Thanks!!! it works! Now, another question. C:UsersanonymousDesktopaaa.au3(16,16) : ERROR: AU3RecordSetup(): undefined function. what can be the reason for that?
  10. I Installed the SciTE4AutoIt3 and indeed there AU3Recorder in the Tools, but after pressing it I get an error message: "The program can't start because MSVCR100.dll is missing from your computer. Try reinstalling the program to fox this problem. I uninstalled it and reinstalled it and it didn't help.
  11. Ok, now how can i find the record option?
  12. Hi, I am a new user in the GUI automation tests. 1.Is there is any tutorial for installing the tool? I need the whole package. 2.I tried to Install the AutoIt tool in windows 7 62bit by using the default option (X86). Is it OK? 3.After installing it, i opened the sciTE script editor, and checked under "tools" in the menu if there is "Record" and didn't find it there. I tried also to save the file first, and still didn't find it. How can i record the scenario i want to? Thanks
  13. Hi I guess it's going to be a silly question but what do you mean by saying IE.au3 and the functions ... Thanks.
  14. Hi I found the problem, I add to change AU3RecordSetup to _AU3RecordSetup (Added the under score), somehow the record create it without the line. Thanks.
  15. Hi In the beginning I want to record a sanity script using mouse and keyboard, I made some tests and it seems as working fine but I could see that there are some fields that the text is not inserted, I tried IE, Chrome and Firefox and the same result, is there any solution? Thanks.
×
×
  • Create New...