Ho to run test complete project using command line? - automation

I have a TestComplete project, called: automation.pjs, which contains some tests.
I want to run those tests using the command line and observe the results in the command line too.
I'm using TestComplete 14 on Windows OS.
Is it possible? Which command shall I run?
Do I need to download a specific plugin?
Thank you.

https://support.smartbear.com/testcomplete/docs/working-with/automating/command-line-and-exit-codes/command-line.html
You can also input these commands into windows task scheduler to have them run periodically!
-specify the path to your testcomplete.exe, input arguments such as /r, /e, /p etc.
e.g
cd ..\..\Program Files (x86)\SmartBear\TestComplete 14\Bin
TestComplete.exe "C:\Users\user.name\documents\ProjectSuite1\automation.pjs" /r /e

Related

mem_test.bat file does not execute

I am in the middle of designing a schematic in Xilinx ISE 14.7 core generator and I've run into a little problem which I need help with. I need to run mem_edit.bat file in order to run the memory editor application and create a .coe file. Whenever I run the file, command prompt just flashes on the screen without running the commands. How do I run mem_edit.bat to be able to run memory test. I have run the file in a static command prompt session and inserted a pause in the code to no avail. I have also run the commands directly in command prompt and still no success. Please help me as I am on a timeline and I need to finish this fast. I am running on a 64 bit windows10 machine. I am kinda new to Xilinx ISE so please go a bit easy on me. The contents of mem_edit.bat have been quoted below
#echo off
REM Script to launch Xilinx memory editor
set CLASSPATH=
set JAVA_HOME=
"%XILINX%\java\nt64\jre\bin\java" -DXILINX="%XILINX%" -DMYXILINX="%MYXILINX%" -cp "%XILINX%\coregen\lib\encore.jar;%XILINX%\coregen\lib\coreutil.jar;%XILINX%\coregen\lib\sim.jar;%XILINX%\coregen\lib\xcc.jar;%XILINX%\coregen\lib;%XILINX%\coregen\resources" com.xilinx.iputils.memory.editor.CoreGen2RunMemoryEditor 2> NUL
I have managed to solve the issue. I happened to stumble on the directory where the ISE cmd short cut is saved C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Xilinx Design Tools 1\ISE Design Suite 14.7\Accessories. I run the file and Kaboom, the ISE cmd fired up. I entered mem_edit.bat and the application is up and running.

SpecRun.exe: run .feature or .playlist file from command line

Good day. I have a several .feature files:
1.feature
2.feature
1.playlist
2.playlist
etc.
I can run they separatelly in visual studio:
-any feature file in debug mode
-any playlist with Test Explorer.
But if i need to run one of they from command line, what i should do?
If i use SpecRun.exe run
SpecRun.exe run %profile%.srprofile "/baseFolder:%~dp0\bin\Debug" /log:specrun.log
this performs launch of ALL scenarios in ALL .feature files.
Have a look at the command line switches of the SpecRun.exe here http://specflow.org/plus/documentation/SpecFlowPlus-Runner-Command-Line/
You are looking for /filter to filter your execution to a single scenario.
The format of it is documented here: http://specflow.org/plus/documentation/SpecFlowPlus-Runner-Profiles/#Filter

I am trying to open Jmeter by the batch file but it gives me a Windows error

Here is the related error its showing:
java.exe is not a recognized file as an internal or external command,
operable or external command
errorlevel=9009
i was getting the same error on WIndows 8.1(64 bit) and checked java path but it was ok
so i just run my jmeter.bat with Run as Administrator and it worked for me
Many operating systems have an environment variable such as PATH that contains a list of directories (or folders) to be searched when looking for a command to execute. Commands that can be found via the PATH are commonly called external commands. The program that reads the command line or the batch file and invoked the commands may have a number of built in commands, these are commonly called internal commands.
I suggest you examine the PATH (or equivalent) set when your java command executes from the command line and also when execution is attempted from the batch file. Compare the two and make sure the directory containing your java.exe is in the PATH.
Does not work with Java 9 beta:
Running:
C:\java -version
Gives:
java version "9-ea"
Just go into command line and run:
java -jar ApacheJMeter.jar
Set the correct Java Path (installed in your system) in Computer -> Advanced System settings -> Environment Variables -> Ok -> System Variables -> Path
I got the same issue and resolved by following the above steps.
I tried everything, this eventually worked.
Within System Variables:
PATH = "C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files\Java\jdk1.8.0_101\bin"
May help someone.
This error occurs due to the path has not been set properly.
Either you can set it in environmental varialables or right click jmeter .bat file,choose edit set the path their,for reference see the jmeter.apache.org user manuals.
For me, my Java path has a space in it and jmeter said it can't find Java
/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
.. I looked at the jmeter.sh script and saw it got the path from "Plugin-Ins" .. onward. I tried just commenting out the exit command after that check in the script .. and then I was able to run jmeter.
So apparently the validation logic has a bug, where the error message about can't find java is in fact not true (if Java is indeed set up correctly), so it can be ignored.
For windows 8.1 Users:
Error when trying to run jmeter.bat
Error message:
Not able to find Java executable or version. Please check your Java installation. errorlevel=2
Press any Key to continue
Resolution:
Right Click jmeter.bat and Run as Administrator.
This worked for me, hope this helps. Good luck
Set the correct JM_LAUNCH variable to java.exe
For Windows XP users set Java environment by following the steps here:
http://www.tutorialspoint.com/jmeter/jmeter_environment.htm
Note the path depends on your installed JDK.
And download the file from:
https://svn.apache.org/repos/asf/jmeter/trunk/bin/jmeter.bat
Then replace your jmeter.bat with the downloaded file.
If you have installed Java and still you get this error, please set the java_home path to below using typing below command in terminal:
export JAVA_HOME="/Library/InternetPlugIns/JavaAppletPlugin.plugin/Contents/Home"
Since I run many versions of Java.. I modified jmeter.bat.
rem JM_START - set this to "start" to launch JMeter in a separate window
rem this is used by the jmeterw.cmd script.
rem
rem =====================================================
setlocal
rem Minimal version to run JMeter
set MINIMAL_VERSION=1.8.0
set PATH=%PATH%;C:\Program Files (x86)\IBM\Java80\jre\bin <<< add This line to jmeter.bat
Copied the JAVA executable from Installed version of Java from C:\Program FilesJava\jdk1.8.0_191\bin and pasted in the folder where the jmeter bat resides and it worked for me.
Not exactly the same issue but somebody might find it helpful
Do not double click jmeter.bat but instead ApacheJMeter.jar in the same directory
For me jmeter.bat run but for a brief moment closing almost immediately and not prompting any error. Above workaround allowed me to start working
if JAVA -version shows as blank or empty in the command prompt (CMD) then you need to clear the all java paths in environment variable and again add JAVA_HOME=C:\Program Files\Java\jdk-11.0.15.1
path= C:\Program Files\Java\jdk-11.0.15.1\bin;
if you see C:\Program Files\Common Files\Oracle\Java\javapath; like this remove this
and try in new CMD prompt then Java -version will work.

How to run a CruiseControl task as an administrator in Windows Server 2008

I'm currently using CruiseControl.NET to automate my build. We have two different ways to build a solution in my build environment - one is through the Keil uVision4 IDE, the other is through Visual Studio 2008.
I've successfully gotten the Visual Studio solution to build properly using CruiseControl.NET and have created a batch file which properly uses Keil's uVision command line interface to compile my uvproj Project (compilation details here).
Problem Description
1) I can successfully execute the build script on my Windows 2008 server and build the project if I create a command prompt with administrator privileges (I'm doing this manually - start -> run -> cmd with ctrl-shift-enter to run as admin).
2) However, if I create a command prompt without administrator privileges, and attempt to execute the batch file, the batch file won't work unless I accept the prompt asking me to confirm admin rights are required to run the batch script.
How do I automatically execute a batch file as an administrator through CruiseControl?
Is this something that could be automated using the RunAs command?
Technical details
1) The batch file being executed is pretty simple - it deletes the old output and re-makes the output, creating a build log file in the location below.
set BuildLogLocation=BuildLog\BuildLog.txt
echo on
cd ../..
cd PTM
rmdir /s /q output
mkdir output
mkdir BuildLog
C:\Keil\UV4\UV4.exe -r myProj.uvproj -o %BuildLogLocation%
echo ErrorLevel of build is %ERRORLEVEL%
echo build complete, see %BuildLogLocation%
2) Currently I'm looking to use the Exec functionality to run the Keil build script above:
<Exec>
<Command>C:\myProject\Build\KeilBuild\BuildScript.bat<Command/>
<buildTimeoutSeconds>600<buildTimeoutSeconds/>
<!-- Details about error codes can be found here:
http://www.keil.com/support/man/docs/uv4/uv4_commandline.htm -->
<successExitCodes>0,1</successExitCodes>
<Exec/>
Related questions:
How can I use a build server with Keil uVision4 (MDK-ARM), script a build, use a makefile? (Electrical Engineering)
Execute a command-line command from CruiseControl.NET (Stack Overflow)
Can you run CCService, the CruiseControl.NET Windows Service, as a user who has administrative permissions? I'd try that first.
If that doesn't work, I would use runas to run your script. You'll have to embed the administrative user's password in the script calling runas.
I know this is old but, Did you get an offical way to do it Via Cruise Control?
Normally I create this and call it to call other processes "As Admin".
Make a ".VBS" script with This in the contents:
Dim strBatchPath
strBatchPath = "PATH-TO-FILE.EXE"
Set runBatch = CreateObject("shell.application")
runBatch.shellexecute strBatchPath,,,"runas",1
That could be an option to people that can't find an official way
You could try psExec from sysinternals. If you don't need to run as a nt-authority account you should be able to use this in the same way as runas.
It allows you to pass in the username/password as a switch (if memory serves)
I have Discovered that when using PSEXEC and using the -h switch, it then "runs as admin" on destination
e.g.
psexec -h \ServerToRunOn /accepteula -u DOMAIN\USER -p PASSWORD "PATH-TO-FILE"
I am Using CC.Net to call a batch file with the above in. This will run that file as Admin

How can I run a Windows shell script prior to launching an application?

Is there a way to configure an application shortcut so that a Windows shell script is run prior to kicking off the application? In my case, I want to back-up some files before the application runs.
Thanks!
You could change the application shortcut to actually run the shell script and just add a START command to the end of the script so it runs the program once complete.
IE: change the notepad shortcut from %SYSTEMROOT%\Windows\Notepad.exe to c:\launchNotepad.bat and have launchnotepad.bat be something like
COPY importantfile.txt importantfile.txt.bak
START %SYSTEMROOT%\Windows\Notepad.exe importantfile.txt