sridhar_nvm Posted June 13, 2019 Share Posted June 13, 2019 We are trying to open a certain windows application and take a screenshot of that application and save it in a specific path through auto it script. It's working fine on my local machine triggered by Jenkins but the same code is not working on a remote server (multiple users can log in). And we have provided the admin access inside services.msc for jenkins. When we start the Jenkins job it is able to call the autoit script and open the windows application which is the first line in the autoit script as well (it was running in the task manager) but somehow not able to complete the task and the job goes on running. Link to comment Share on other sites More sharing options...
Earthshine Posted June 13, 2019 Share Posted June 13, 2019 (edited) are you running as admin? jenkins may be, but is autoit script? https://www.autoitscript.com/autoit3/docs/keywords/RequireAdmin.htm Edited June 13, 2019 by Earthshine My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
sridhar_nvm Posted June 17, 2019 Author Share Posted June 17, 2019 (edited) Yes we are running auto script with admin privileges. Our code needs to interact with GUI but if we run it through jenkins on remote server it is running that as a background task. And this is our script Run("notepad.exe") $hWnd = WinWait("Untitled - Notepad", "", 10) WinActivate($hWnd) Send("Sending some special characters:{ENTER 2}") Send("{PRINTSCREEN}") Send("!f") Send("{UP 1}{ENTER}") Send("{TAB}{ENTER}") Run("mspaint.exe") $hWnd = WinWait("Untitled - Paint", "", 10) WinActivate($hWnd) Send("^v") Send("^s") WinWaitActive("[CLASS:#32770]") Send("D:\scripts\ScreenshotPaint.jpeg") Send("{TAB 3}{ENTER}") If WinExists("Confirm Save As") Then Send("{TAB}{ENTER}") EndIf Send("!+{F4}") This works flawlessly in local machine. When I run above script manually it works fine even in remote server but not with the Jenkins. Edited June 17, 2019 by sridhar_nvm Link to comment Share on other sites More sharing options...
Developers Jos Posted June 17, 2019 Developers Share Posted June 17, 2019 (edited) 36 minutes ago, sridhar_nvm said: but not with the Jenkins Makes sense as that likely runs in the background, thus the Send() commands will fail. Use ControlSend() instead. Jos Edited June 17, 2019 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. 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