Run command line command from CruiseControl.NET

I have this code in the configuration of CruiseControl.NET :

<exec>
    <executable>C:\Windows\System32\cmd.exe</executable>
    <buildArgs>/C SETX SELENIUM_BROWSER googlechrome /M</buildArgs>
</exec>

Then comes the NUnit run command , which will run some Selenium on my site. The idea is that this command modifies the testing browser (system environment variable) before running the tests.

The problem is that the command is not working. Tests still use Firefox's default browser. It works if I manually change the environment variable.

What am I doing wrong?

EDIT:

I tried to put the command in a batch file and execute this, but it still doesn't work:

<exec executable="C:\CCNet\setChrome.bat" />

The contents of the batch file:

SETX SELENIUM_BROWSER googlechrome /M
+5
1

:

<exec>
    <executable>cmd</executable>
    <buildArgs>/C SETX SELENIUM_BROWSER googlechrome /M</buildArgs>
</exec>

, NUnit .

UPDATE:

environment . :

<exec>
    <executable>make</executable>
    <baseDirectory>D:\dev\MyProject</baseDirectory>
    <buildArgs>all</buildArgs>
    <buildTimeoutSeconds>10</buildTimeoutSeconds>
    <successExitCodes>0,1,3,5</successExitCodes>
    <environment>
        <variable>
            <name>MyVar1</name>
            <value>Var1Value</value>
        </variable>
        <variable name="MyVar2" value="Var2Value" />
    </environment>
</exec>

, , - .

+8

All Articles