How to run specflow scenarios from command prompt

1,824 views
Skip to first unread message

Bharathan Kumaran

unread,
Dec 11, 2015, 2:32:40 PM12/11/15
to SpecRun
How to run specflow scenarios from command prompt,
I am newbie to specflow, can anyone guide how to run specflow from command prompt.
I have located the specs floder and the runtests.cmd file ,
when i run the command form the command line i am getting the below out put , no error has been thrown, but none of the test case are executed.

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:01.90
The system cannot find the path specified.

Bharathan@INBHARATHAN_WIN C:\Users\Gayathri\Projects\project-FunctionalTests\Source\Specs
> SpecRun.exe run Default.srprofile "/baseFolder:C:\Users\Gayathri\Projects\project-FunctionalTests\Source\Specs\\bin\Debug" /log:specrun.log
'SpecRun.exe' is not recognized as an internal or external command,
operable program or batch file.



The below is my Default.srprofile.xml file
<?xml version="1.0" encoding="utf-8"?>
  <Settings projectName="" projectId="{}" />
  <Execution stopAfterFailures="3" testThreadCount="1" testSchedulingMode="Sequential" />
  <!-- For collecting by a SpecRun server update and enable the following element. For using the 
      collected statistics, set testSchedulingMode="Adaptive" attribute on the <Execution> element.
    <Server serverUrl="http://specrunserver:6365" publishResults="true" />
  -->
  <TestAssemblyPaths>
    <TestAssemblyPath>Specs.dll</TestAssemblyPath>
  </TestAssemblyPaths>
  <DeploymentTransformation>
    <Steps>
      <!-- sample config transform to change the connection string-->
      <!--<ConfigFileTransformation configFile="App.config">
        <Transformation>
          <![CDATA[<?xml version="1.0" encoding="utf-8"?>
                <connectionStrings>
                  <add name="MyDatabase" connectionString="Data Source=.;Initial Catalog=MyDatabaseForTesting;Integrated Security=True" 
                       xdt:Locator="Match(name)" xdt:Transform="SetAttributes(connectionString)" />
                </connectionStrings>
</configuration>
]]>
        </Transformation>
      </ConfigFileTransformation>-->
    </Steps>
  </DeploymentTransformation>
</TestProfile>

Stephen McCafferty

unread,
Dec 14, 2015, 9:43:35 AM12/14/15
to SpecRun
'SpecRun.exe' is not recognized as an internal or external command,operable program or batch file.

This means you are in the wrong directory, i.e. specrun.exe is not being found. At first glance there is nothing wrong with your command line (although you have got "\\bin" where "\bin" is presumably what you wanted).

SpecRun.exe is located in the \packages\SpecRun.Runner.1.2.0\tools\ directory after adding SpecRun to your project. Run the command line from there instead.




Reply all
Reply to author
Forward
0 new messages