Test Data Manager

Expand all | Collapse all

Javelin execute batch (.bat) file

Jump to Best Answer
  • 1.  Javelin execute batch (.bat) file

    Posted 11-06-2019 03:23 PM
    Hi All,

    Can you help us execute batch (.bat) from javelin. 

    our bat file has simple code as below which is saved as "try.bat"

    @ECHO OFF
    ECHO Congratulations! Your first batch file executed successfully.
    PAUSE
    below happens when i run batch file:

    below is Javelin with invoke process activity:
    but nothing happens when i execute the javelin file. it opens empty CMD.

    Can you help us resolving this issue.

    ------------------------------
    G M V Rajesh
    ------------------------------


  • 2.  RE: Javelin execute batch (.bat) file

    Posted 11-06-2019 04:16 PM
    Hi Rajesh,

    Please try below example and see if it works for you.

    • Try inserting >CON at the end of your ECHO statement as shown below and save the bat file.

    @ECHO OFF
    ECHO Congratulations! Your first batch file executed successfully.>CON
    PAUSE


    • Make sure you are giving the correct Directory and Complete path of the bat file in the respective fields as shown below.  You can use variables to make it easy to detect/edit.


    • Now when you try to run the flow, you will see the output bat window waiting for the user's input to exit.




    Best Regards,
    Sunil G...


  • 3.  RE: Javelin execute batch (.bat) file

    Posted 11-06-2019 08:41 PM
    Hey Sunil,
    Thanks for the quick help. Above Batch file with basic script is working fine. Can you help us execute actual bat script we are trying to achieve.

    our Batch script is calling maven script which is working fine when executed with out javelin. The maven script has selenium code which opens browser after few pre-checks.

    Batch file "Execute.exe" contains script with file name 
    @echo off
    cd D:\Selenium_Workspace\M2Conv\tdm_dataprovisioning
    call mvn test -DTDM_JOB_ID=1 > CON

    CMD screen which appears running Maven script when executed with out javelin integration: (runs properly and opens chrome)

    CMD screen when executing via javelin:

    only first line is being displayed and CMD screen closes immediately after that. And even the first line is being displayed only because of "> CON" which i gave in batch script. Screen is empty when i don't give CON. Can you help executing our Bat file which is calling maven script.





  • 4.  RE: Javelin execute batch (.bat) file
    Best Answer

    Posted 11-07-2019 01:35 AM
    Hi Rajesh,

    It probably can't find the path because the Javelin context is the c-drive. Maybe it helps if you start the script with 'd:' in the first line.

    Best regards,
    Klaas-Jan


  • 5.  RE: Javelin execute batch (.bat) file

    Posted 11-07-2019 10:14 AM
    Hi Klaas-Jan Lute,

    We have provided 'D:' location for  working directory, batch file location and in the batch script. Javelin is not throwing any "path not found" error while executing. its just opens and closes the cmd prompt with out executing the script. 

    Can you explain more on - "if you start the script with 'd:' ". which script are you talking about?


  • 6.  RE: Javelin execute batch (.bat) file

    Posted 11-07-2019 12:33 PM
    Hi Klaas-Jan Lute,
    It worked Thanks. Placed D: in my batch file.


  • 7.  RE: Javelin execute batch (.bat) file

    Posted 11-27-2019 01:33 PM
    Hi ,
    Can you please also guide for how to pass username,password, port in the arguments or using variables while using invokeprocessactivity ?

    Before running subsetting we need to enter these details for the DB . I am trying to automate the run .


  • 8.  RE: Javelin execute batch (.bat) file

    Posted 11-28-2019 01:30 AM
    Hi Varun,

    When using the InvokeProcessActivity option with a batchfile the user running the service (CATestDataManagerPortal) should be authorised for the database action. 
    For subsetting I don't use the invoke process, I use the Javelin Bulk-copy element. This has all the options available to set up the connection.

    Best regards,
    Klaas-Jan