HiteshSharma

Run the script in background

6 posts in this topic

#1 ·  Posted

Hi Guys, I want to run the scripts in the background so that I can continue other work. To be specific, when I am running my Job from Jenkins then it should run in the background.

I have seen a couple of posts but they are not much help. Is anyone done recently? 

Any pointer would be really appreciated.

 

Share this post


Link to post
Share on other sites



#2 ·  Posted

What isn't working from the background? Just like I mentioned in the other thread... it really helps when you share details to be able to help you.

Jos

 


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#3 ·  Posted

Hi Jos, Below is my script and I want to run the actual navigation in the background from beginning till the end. So when I start running the scripts, it will run in the background and once it's finished, I can directly go to my folder and see the log file. 

Hope this help and if you need any more details can you please be specific as I am new to this.

 

#include <Date.au3>

;Set variable and path
$exePath =".exe path"
$logPath="log path"
$saveAsWin = "Save As"

;Locators
$winTitle = "windiw title name here"

;Launch the executable filC:\Autoite
Run($exePath,"")


While Not WinExists($winTitle,"")
   WEnd
;Wait for some seconds

;Check  the CiAssign window is launch or No

if WinExists($winTitle,"") Then
   SendKeepActive($winTitle)
      Sleep(500)
   ;Wait for some seconds and navigate to the database
   Sleep(2000)
   Send("!f")
   Sleep(2000)
   Send("{ENTER}")
   SendKeepActive("")
   ;Setup a mechanism to to get the System current date and time
   ;and contcatinated with generated log files
   $tCur = _Date_Time_GetSystemTime()
   $string = _Date_Time_SystemTimeToDateTimeStr($tCur)
   $string2 = StringReplace($string,'/','')
   $string3 = StringReplace($string2,':','')
   ConsoleWrite($string3)
   $text = ControlGetText("Save As","","[CLASS:Edit; INSTANCE:1]")
   ConsoleWrite($text)

   ;Logic to save to log file at given location
   Sleep(2000)
   Send($logPath)
   SendKeepActive($saveAsWin)
   Sleep(2000)
   Send("{ENTER",false)
   Sleep(2000)
   Send("^a")
   Sleep(2000)
   Send("{BACKSPACE}")
   Sleep(2000)
   Send("CiAssignLog_ " & $string3 & ".txt")
   Sleep(5000)
   Send("{ENTER}",false)
   SendKeepActive("")
EndIf


 

Share this post


Link to post
Share on other sites

#4 ·  Posted

Hi Jos, any pointers, please ? 

Share this post


Link to post
Share on other sites

#5 ·  Posted

Hi Jos,  Can you please also see this query too?

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

I am sorry, but am not your "on demand scripting boy" so please show some patience. I am now off to the beach as I am still enjoying a vacation. ;)

Jos

Edited by Jos
Typos

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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