Jump to content
CiaronJohn

Running AutoIT Script in Jenkins

Recommended Posts

Hi All, 

I have this autoIT script. Which will be build in jenkins. If i just run it manually, it works, but in jenkins, the control send is not working.

Func _JMI_jnknsInitLog($sSpiderTitle)
    Local   $sSpider_F5_Class = $g_iJM_Spider_F5_Class, _                       ;   Class value depending in the AutoIt v3 Window info
            $sSpider_File_Class = $g_iJM_Spider_File_Class, _               ;   Class value depending in the AutoIt v3 Window info
            $sSpider_Software_Path_Class = $g_iJM_Spider_Software_Path_Class, _     ;   Class value depending in the AutoIt v3 Window info
            $sSpider_Run_Class = "テスト実行中", _                        ;   Class value depending in the AutoIt v3 Window info
            $sSpider_Path = "", _                               ;   Setting initial value to null
            $sSpider_Software_Path = "", _                          ;   Setting initial value to null
            $sSSpider_Local = "", _                             ;   Setting initial value to null
            $sSpider_Log_TxtFile = "", _                            ;   Setting initial value to null
            $sUnitTest_Log_TxtFile = ""
    Local   $iReturnF5

    $iReturnF5 = 0

    $sSpider_Software_Path = ControlGetText($sSpiderTitle,"",$sSpider_Software_Path_Class)
    $sSpider_Path =  StringTrimRight($sSpider_Software_Path,21)
    $sUnitTest_Log_TxtFile = $sSpider_Path & "\UnitTest\log.txt"
    $sSpider_Log_TxtFile = @ScriptDir & '\Log.txt'
    
    ; Copy the test Design File
    ClipPut($g_sJMI_TestDesign_File)
    WinActivate($sSpiderTitle)
    
    Sleep(200)
    
    ; Send Keys
    ControlSend($sSpiderTitle, "", $sSpider_File_Class, "!aft")
;~  Send("{ALT}")
;~  Send("{F}")
;~  Send("{T}")
    ; Wait for 1 second
    WinWait("","",1)
    ; Pastes the copied test design file path
     ControlSend($sSpiderTitle, "", $sSpider_File_Class, "^v", 1)
     ControlSend($sSpiderTitle, "", $sSpider_File_Class, "{ENTER}", 0)
;~  Send("^v")
;~  Send("{ENTER}")
    WinWait("","",5)
    ; Save the configuration of the DSpider
    ControlSend($sSpiderTitle, "", $sSpider_File_Class, "^s", 0)
;~  Send("^s")
    WinWait("","",5)

    Sleep(2000)
    _JEH_jnknsCreateLogFile("0", "Starting", $sSpider_Log_TxtFile)
EndFunc     ;==>_JMI_jnknsInitLog

This is how i run it in jenkins

image.thumb.png.ab4092cbcccc7c12b1bbac4b636abe32.png

Thanks,

image.png

Edited by CiaronJohn

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

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...