TomaszWojciechowski Posted April 9, 2020 Share Posted April 9, 2020 Hello I have script: Local $sTitle Func _GetLanguage() Switch StringRight(@MUILang,2) Case "09" Return "English" Case "15" Return "Polish" EndSwitch EndFunc ;==>_GetLanguage ConsoleWrite($sTitle) If _GetLanguage() == "English" Then Assign("sTitle", "Open") If _GetLanguage() == "Polish" Then Assign("sTitle", "Otwieranie") WinWaitActive($sTitle) ControlFocus($sTitle,"","Edit1") ControlSetText($sTitle,"","Edit1",$CmdLine[1]) ControlClick($sTitle,"","Button1") that simply operates on "Open" window used for selecting files to upload. I have application under test, and when I run tests at localhost (tests are being fired on the same machine where web browser is being installed) then everything works ok. But when I run tests remotelly (e.g. by Bamboo's remote agent, or by PowerShell's remote access) then application under test still displays "Open" window, but AutoIT doesn't execute this script on it. What's important- if AutoIT is still in memory and I open this "Open" windows manualy, then script is being fired. How to fix this? Link to comment Share on other sites More sharing options...
faustf Posted April 9, 2020 Share Posted April 9, 2020 the code is correcct for my opinion , the questions is : you download a code in remotely machine and after run it ? or do somthing dfferents ? Link to comment Share on other sites More sharing options...
TomaszWojciechowski Posted April 10, 2020 Author Share Posted April 10, 2020 @faustf .au3 file is inside Java project Link to comment Share on other sites More sharing options...
Nine Posted April 10, 2020 Share Posted April 10, 2020 15 hours ago, TomaszWojciechowski said: AutoIT is still in memory and I open this "Open" windows manualy, then script is being fired Seems to me that AutoIt waits at WinWaitActive($sTitle) endlessly. So you would need to WinActivate ($sTitle) before. If that doesn't work, log all returns value and variables in a log file to follow path of the script. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
faustf Posted April 10, 2020 Share Posted April 10, 2020 15 hours ago, TomaszWojciechowski said: @faustf .au3 file is inside Java project and why you dont use java? Link to comment Share on other sites More sharing options...
SciMan Posted October 3, 2022 Share Posted October 3, 2022 Hello! I have similar problem and I decided to write here instead to open a new topic. I'm trying to open a project via "Open Project" from "File" menu of an IDE for building of software for specific processor. When the "Open" dialog is shown I want to write the path to the project file and click on "Open" button. This is executed on a remote node (a part of an automated build system). When I'm connected via remote desktop and execute the script, all works fine. Even if I click outside of the application to change the focus. But when I'm disconnected from this PC and the script is executed from the build system, it stops on the dialog "Open" and stays forever. It just doesn't set the text in the edit box of the dialog. If I connect in this moment to the PC with remote desktop and click on the dialog "Open" to get the focus, all further actions are correctly executed. I tried to set the focus and currently in my script I just send the text to the needed dialog, but I cannot solve my problem. Here is my script: Local $ProjectPath = "Path\to\my\project" Local $ProjectName = "project_name" Func _WinWaitActivate($title,$text,$timeout=0) WinWait($title,$text,$timeout) If Not WinActive($title,$text) Then WinActivate($title,$text) WinWaitActive($title,$text,$timeout) EndFunc Run("C:\Program Files (x86)\MyIde.exe") WinWait("Welcome","", 10) ControlSend("My Ide", "", "", "{ALTDOWN}f{ALTUP}{DOWN}{ENTER}") _WinWaitActivate("Open","") ControlSetText("Open", "", "Edit1", $ProjectPath & "\.solproject") ControlSend("Open", "", "Edit1", "{ENTER}") _WinWaitActivate($ProjectName & " - My Ide","") ControlSend($ProjectName & " - My Ide", "", "", "{CTRLDOWN}b{CTRLUP}{ENTER}") WinWait("Building Workspace","", 10) WinWaitClose ("Building Workspace", "", 120) ControlSend($ProjectName & " - My Ide", "", "", "{ALTDOWN}f{ALTUP}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{ENTER}") WinWait("My Ide","", 10) WinKill ("My Ide") So the script hangs on the line: _WinWaitActivate("Open","") Can somebody help me, please? 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