Running Unit Test from test manager that run bat file from command line

Hi ,
I am trying to run Jsystem (java framewotk) from command line using runScenario.bat thru unit test that i associated to test in test manager.
the idea is that when i ran the automated test  from MTM - it will run the the unit test that will run the appropriate test case in java.
i wrote the code like this : 
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace UnitTestProject3
[TestClass]
public class UnitTest1
[TestMethod]
public void TestMethod1()
try
String command = "c:\\JSYSTEM\\runner\\runScenario.bat
c:\\Users\\ryeshua\\Source\\Workspaces\\Auto1\\my-tests-project\\target\\classes scenarios\\feature1 RoeySetup.xml ";
System.Diagnostics.ProcessStartInfo procStartInfo =
new System.Diagnostics.ProcessStartInfo("cmd", "/c " + command);
procStartInfo.RedirectStandardOutput = true;
procStartInfo.UseShellExecute = false;
//procStartInfo.CreateNoWindow = true;
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.StartInfo = procStartInfo;
proc.Start();
string result = proc.StandardOutput.ReadToEnd();
Console.WriteLine(result);
catch (Exception objException)
// Log the exception
and when i ran it from visual studio it worked perfect. and update  the Jsystem logs of the junit test in the jsystem/runner/log folder.
but when i added it to associated test and ran it from MTM - it pass but it does not update  the logs in jsystem folder.
the problem that i dont know what is not working. i cant see the output of it when i ran from mtm but can see when i ran from VS.
i am using VS 2013 Pro with MTM 2013.
please advice
Roey

Hi Roey,
Thank you for posting in MSDN forum.
Based on your issue, could you please tell me how you generate the log file under the jsystem folder?
Generally, I know that when we run unit test from VS IDE, the file will be saved into the local machine. But when we run unit test from MTM, the unit test method will be run on the test agent machine, so the file will be saved into the test agent machine.
Therefore, I suggest you could check if you did not see the updated logs file in jsystem folder on the test agent machine.
In addition, I suggest you could try to copy this unit test project on this test agent machine and then run the unit test method using mstest.exe in command line and then check if you can update the logs file.
https://msdn.microsoft.com/en-us/library/ms182489.aspx?f=255&MSPPError=-2147217396
If you have any updated message about this issue, please tell me.
Best Regards,
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • Running bat-files from Java

    Hello,
    I have been trying to launch a bat-file from my Java code, running under windows, but with no success.
    Here is my simple code:
    Runtime.getRuntime().exec(new String[] {
             "C:\\temp\\test.bat"
          });This does nothing at all and generates no exception. Any suggestions?

    It seems java has a real problem with this... if you
    want to run another java program, for instance, you
    cannot do that either with String cmd="cmd.exe /C
    java myProgram"
    I need to pass parameters from one program into the
    program I'm going to open using java, that is why I
    need to call it from my first program. It can open
    executables and shortcuts, but has a real big problem
    doing things with the command line.No it doesn't have a problem with it. You just must be doing something wrong. By the way, since "java(.exe)" is already an executable, there's little value in wrapping that by the "cmd.exe" shell (unless you want to use the command shell for some reason such as passing the redirector (>) symbols to it to let it redirect stdout / stderr to a file)

  • Running a Bat file from a stored procedure

    This is part II of Re: Need to run bat file from application express
    I thought I would open a new thread
    I thought I had this fiqured out but it still doesn't work
    1) I granted CREATE EXTERNAL JOB to my user
    2) startup the OracleJobScheduler Service
    3)
    create or replace
    PROCEDURE RUN_OS_COMMAND(p_cmd IN varchar2)
    is
    v_job_exists pls_integer:=0;
    begin
      select count(1)
      into  v_job_exists
      from  all_scheduler_jobs
      where job_name='JAVA_EXE';
      if v_job_exists>0 then 
        dbms_scheduler.drop_job(job_name =>'JAVA_EXE');
      end if;
      dbms_scheduler.create_job
      (   job_name          =>'JAVA_EXE'
        , job_action        =>p_cmd
        , job_type          =>'executable'
        , enabled           =>false
        , auto_drop         =>false
        , start_date        =>systimestamp
      dbms_scheduler.run_job(job_name =>'JAVA_EXE');
    end;test.bat is del test.csv
    I run this
    begin
      RUN_OS_COMMAND('C:\temp\test.bat');
    end;
    / anonymous block completed
    It runs with no errors but does not run the bat file... what am i missing, thanks Doug

    LLUSERSPROFILE=C:\Documents and Settings\All Users
    APPDATA=C:\Documents and Settings\wblincoe\Application Data
    CLASSPATH=.;[ORACLE_HOME]\jdbc\lib\ojdbc6.jar;c:\myjar\xdocore.jar;c:\myjar\i18nAPI_v3.jar;c:\myjar\xdoparser.jar;c:\myjar\xmlparserv2.jar
    CommonProgramFiles=C:\Program Files\Common Files
    COMPUTERNAME=WBLINCOELT
    ComSpec=C:\WINDOWS\system32\cmd.exe
    DEFLOGDIR=C:\Documents and Settings\All Users\Application Data\McAfee\DesktopProtection
    FP_NO_HOST_CHECK=NO
    HOMEDRIVE=C:
    HOMEPATH=\Documents and Settings\wblincoe
    LDMS_LOCAL_DIR=C:\Program Files\LANDesk\LDClient\Data
    LOGONSERVER=\\03N-DAYT-DC01
    NUMBER_OF_PROCESSORS=2
    OS=Windows_NT
    Path=C:\OraHome_1\jre\1.4.2\bin\client;C:\OraHome_1\jre\1.4.2\bin;C:\app\wblincoe\product\11.1.0\db_1\bin
    PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
    PERL5LIB=C:\oracle\product\10.2.0\http_1\sysman\admin\scripts;C:\oracle\product\10.2.0\http_1\perl\site\5.6.1\lib;C:\oracle\product\10.2.0\http_1\perl\site\5.6.1;C:\oracle\product\10.2.0\http_1\perl\5.6.1\lib\MSWin32-x86;C:\oracle\product\10.2.0\http_1\perl\lib\5.6.1;C:\oracle\product\10.2.0\http_1\perl\lib\5.6.1\MSWin32-x86;
    PHPRC=C:\Program Files\PHP\
    PROCESSOR_ARCHITECTURE=x86
    PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 2, GenuineIntel
    PROCESSOR_LEVEL=6
    PROCESSOR_REVISION=0f02
    ProgramFiles=C:\Program Files
    PROMPT=$P$G
    SESSIONNAME=Console
    SystemDrive=C:
    SystemRoot=C:\WINDOWS
    TEMP=C:\DOCUME~1\wblincoe\LOCALS~1\Temp
    TMP=C:\DOCUME~1\wblincoe\LOCALS~1\Temp
    USERDNSDOMAIN=CACI.COM
    USERDOMAIN=CACI
    USERNAME=wblincoe
    USERPROFILE=C:\Documents and Settings\wblincoe
    VSEDEFLOGDIR=C:\Documents and Settings\All Users\Application Data\McAfee\DesktopProtection
    windir=C:\WINDOWS

  • I have e9 running a cpu A. I have e11 now running on cpu B. How do i move my files from A to B?

    I have elements 9 running on computer A. I now have elements 11 running on computer B. How do i move my files from computer A to B?

    Do a full backup using the organizer's backup command on computer A. Then restore that to computer B.
    EDIT It will probably go smoothest if you use some kind of removable drive for the backup location.

  • Running .bat files from java code

    Dear Forum,
    I have seen numerous postings on the web about this question, still I have found no answer that works (for me)
    I�m trying to run a simple .bat file from a piece of java code , however it does not work. No error message , but still.
    Does anyone have a tip?
    best regards
    temuj
    try{
                String cmd = "cmd.exe C:\\mybat.bat";
                Runtime.getRuntime().exec(cmd);
    catch(IOException e){System.out.println("ERROR: "+e);}Message was edited by:
    temujin

    "cmd.exe C:\mybat.bat" is being passed to the OS for execution
    what happens when in a terminal/dos window you execute letter for letter:
    cmd.exe C:\mybat.bat
    The output will be identical to what is happening when java makes this call.

  • Running .bat files from java applications

    Has anyone tried to run a .bat file from a java application?
    I know I can run java commands by getting the application's runtime, but I've a number of *.bat files I like to run from the application without having to extract the commands from the .bat files.
    thks,

    Crikey! You were answered very shortly after you posted your question, and you STILL haven't bothered to come back. And are you going to create a new userid the next time you ask a question, since bat2004 seems tied to this particular question?

  • Run .bat file from Flex

    Hi,
    I'd like to execute a .bat file from Flex. I thought this piece of code should work but no luck
    fscommand("Exec", "C:\\Sandbox\\doSomething.bat");
    Can someone please point me in the right direction?
    Thanks in advance,

    Sandbox does not allow external apps to be run in Flex apps. AIR 2.0 may have this.
    If this post answered your question or helped, please mark it as such.

  • How can I get my books that I download from the Library that are WMA files into my I tunes so I can listen to them

    How can I get my books that I download from the Library that are WMA files into my I tunes so I can listen to them. They have a ton of books but I can only listen to them from my windows media player and I wouldlove to download to my I pod but I have tried everything I can think of it they won't go over.  Someone said all I had to do was copy them over and they would convert but I can't even get them to copy.  Thanks.

    Well it started happening AGAIN with my 2nd IPod. No matter what I did, it Itunes would NOT restore it!
    I finally installed Itunes on my hubby's PC at work and managed to get it restored there.
    Apparently, there must be some sort of compatibility issue with the windows version of Itunes and some other piece of software on my pc.
    And one more important thing! I had to follow the instructions in the other thread that talks about how to correctly uninstall itunes and quicktime, in order to completely eliminate ALL traces of my "first" ipod's existence so it wouldn't demand that I restore it.
    I think the software got "confused" and thought when I connected my 2nd ipod, that it was the 1st and that it still needed to be restored.
    Basically, this is just POORLY written and POORLY tested software!

  • How do I access the photos and videos from my computer that I backed up from my phone to verizon backup assistant plus?

    how do I access the photos and videos from my computer that I backed up from my phone to verizon backup assistant plus?

    You can download the PC (or mac) desktop application. 
    http://support.verizonwireless.com/clc/devices/knowledge_base.html?id=54607
    or you can sign into My Verizon ( http://www.verizonwireless.com/myverizon ) then navigate to MyVerizon/Manage & Store media.

  • After trying to install the new update, I am getting a message from Windows saying that an MC file is missing, reintall Itunes-which I have now done 3 times. How do I fix this?

    I received the new update from Itunes and after installing, I couldnt get into my Itunes.  I get a message from Windows saying that an MC file is missing and  to reinstall I tunes.  I have reinstalled 3 times, the first time I didn't remove the old version, I installed the update over it.  Next I tried the repair function under Control Panel.  After that, I uninstalled Itunes and reinstalled again from the website.  I still get the same message about missing files from Windows.

    Try the following user tip:
    Troubleshooting issues with iTunes for Windows updates

  • How To Run An External .exe File With Command Line Arguments

    Hiya, could anyone tell me how I can run an external .exe file with command line arguments in Java, and if possible catch any printouts the external .exe file prints to the command line.
    Thanks.

    Using the Runtime.exec() command. And read this:
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

  • How do I delete photos from my iPhone that have been downloaded from my pc?

    I am not sure how to delete photos from my iPhone that I have downloaded from my pc or that I have taken with my iPhone (on my camera roll)

    "I am not sure how to delete photos from my iPhone that I have downloaded from my pc"
    The same way you put them there.  The sync process.  open itunes, connect iphone, select what you want on the iphone , sync
    "or that I have taken with my iPhone (on my camera roll)"
    You can delete them when you import the photos to your computer - using whatever softare that you import them with or you can go to the pics and hit the trash can on the bottom of the screen.
    iPhone User Guide (For iOS 5.1 Software)

  • Noticed that my NEF files from Nikon D7000 camera are noticeably different in LT4 vs Nikon software?

    Hello,
    Noticed that my NEF files from Nikon D7000 camera are noticeably different in LT4 vs Nikon software. Read where folks are adjusting setting in LR4 for Nikon camera, but need help in how please. Also, perhaps there is a better way?
    thanks,
    mo

    mo 100 wrote:
    Perhaps there is a better way?
    There is now another way, dunno if you'll consider it better or not :
    ISO Detailer now has infrastructure for supporting camera settings emulation.
    Implemented so far (Nikon only):
    * Picture Control Name (e.g. Neutral, Vivid, ... ) -> Camera Calibration Profile.
    * Active D-Lighting -> Lr basic adjustments.
    If you want other stuff, you'll have to come up with it yourself, by editing a table in lua text format (or supply the information for me to do it).
    Reminder: Ottomanic Importer can do this emulation during import, ISO Detailer is for doing it after import.
    R

  • If I import favorites from IE, does that totally remove them from IE?

    If I import favorites from IE, does that totally remove them from IE?

    I'm quite sure that importing favorites will not delete the originals because it is only "copying" them.
    Hope that helps.

  • How do I delete pics from my iPhone that I have transferred from my computer to my iPhone?

    please help me! How do I delete pics from my iPhone that I have transferred from my computer to my iPhone?

    I guess you transfered them via iTunes Snyc?
    If yes you have to delete them on your computer and sync again with your iPhone

  • How can I delete albums from my Ipad that have been copied from my PC?

    How can I delete photo albums from my Ipad that have been copied from my laptop?

    To delete photos from your device
    In iTunes, select the device icon in the Devices list on the left. Click the Photos tab in the resulting window.
    Choose "Sync photos from."
    On a Mac, choose iPhoto or Aperture from the pop-up menu.
    On a Windows PC, choose Photoshop Album or Photoshop Elements from the pop-up menu.
    Choose "Selected albums" and deselect the albums or collections you want to delete.
    Click Apply.

Maybe you are looking for

  • Iphone 5 update to IOS 7, now visual voice mail does not work

    I updated my Iphone 5 today to ios 7 and when it was done I noticed that when I went into the phone app and tapped on the voice mail icon it immediately dialed into voice mail.  Visual voice mail was not there.  I looked into some forums and turned o

  • How to stretch content div to bottom of page.

    Been messing around with my site so much that I needed to create a new one. However, I can't get to stretch the content div to the bottom of the page if the content text doesn't fill the page. I have a footer at the bottom of the page that stretches

  • Automatic inside folder linking

    There are some features which Illustrator doesn't have which are mind boggling (they've been in Freehand since the beginning). One of them is that Freehand (FH) always looked in the folder where the FH file was for its links. Only if a linked doc wer

  • JDEV 10.1.3: Using "Create" binding on BC view object with ADF Faces Table

    Hello, I am trying to get this to work, but to no avail: I've got a very simple page (ADF Faces - JSPX) created by dragging an iterator from the data control pallete on to my page and picking "ADF Table..." as my chose to create. This creates a table

  • Password file - internal user

    hi all, when we create password file. then internal user is also created along with sys in oracle 9i. as we know that internal has been depricated since 9i. SQL> select * from v$pwfile_users; USERNAME SYSDB SYSOP INTERNAL TRUE TRUE SYS TRUE TRUE rega