[Webtest] problem with properties

Julien Chambert webtest@lists.canoo.com
Wed, 13 Sep 2006 10:37:00 +0200


------=_Part_92601_25672539.1158136620522
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

hello everybody,


      i have a problem: I don't manage to handle my properties files.

   here is my code
-------------------------------------------------------------------
     test.xml
-----------------------------------------------------------------
<project name="FullSuite" default="testSuite" basedir=".">

  <property name="test.xml" value="tests/test.xml" />

  <target name="testSuite" >
    <ant antfile="${test.xml}">
      <property file="test_properties/Mytest.properties"/>
    </ant>
  </target>

</project>
-----------------------------------------------------------------------------
      tests/test.xml
-----------------------------------------------------------------------------
<?xml version="1.0"?>

<!DOCTYPE project [
  <!ENTITY config   SYSTEM "config.xml">
  <!ENTITY testVolontaire   SYSTEM "testVolontaire.xml">
  <!ENTITY testRecrut   SYSTEM "testRecrut.xml">
  <!ENTITY verif SYSTEM "verif.xml">
]>


<project name="test" default="oneTest" basedir="..">
    <property name="webtest.home" location="C:/canoo" />
    <import file="${webtest.home}/lib/taskdef.xml"/>
    <target name="oneTest">
        <webtest name="$(test.Name)">
            &config;
            <steps>
                <ifStep description="if volontaire: $(test.volontaire)"
test="$(test.volontaire)">
                    &testVolontaire;
                </ifStep>
                <ifStep description="else" unless="$(test.volontaire)">
                    &testRecrut;
                </ifStep>
                &verif;
            </steps>
        </webtest>
    </target>
</project>
----------------------------------------------------------------------------------------------------------------
properties/MyTest.properties
--------------------------------------------------------------------------------------------------------------
page.volontaire=t.php
page.recrutement=t_recrut.php
page.test=test-form/test.html

test.Name=MyTest
test.volontaire=true
test.ResultOk=true
---------------------------------------------------------------------------------------------------------------

the problem is that it doesn't care of my properties. for example it
displaies:
          [ifStep]  INFO (com.canoo.webtest.steps.Step) - >>>> Start Step:
ifStep "if volontaire: $(test.volontaire)" (1/122)
it's the same for test.Name.
i'm pretty sure it doesn't come from the properties file because in
testRecrut.xml, a property page.volontaire is used and works fine.

 I don't understand where is the problem.

 thank you for your future answers

Julien Chambert

------=_Part_92601_25672539.1158136620522
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

hello everybody,<br><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; i have a problem: I don't manage to handle my properties files.<br><br>&nbsp;&nbsp; here is my code<br>-------------------------------------------------------------------<br>&nbsp;&nbsp;&nbsp;&nbsp; test.xml<br>-----------------------------------------------------------------
<br>&lt;project name=&quot;FullSuite&quot; default=&quot;testSuite&quot; basedir=&quot;.&quot;&gt;<br><br>&nbsp; &lt;property name=&quot;test.xml&quot; value=&quot;tests/test.xml&quot; /&gt;<br><br>&nbsp; &lt;target name=&quot;testSuite&quot; &gt;
<br>&nbsp;&nbsp;&nbsp; &lt;ant antfile=&quot;${test.xml}&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;property file=&quot;test_properties/Mytest.properties&quot;/&gt;<br>&nbsp;&nbsp;&nbsp; &lt;/ant&gt;<br>&nbsp; &lt;/target&gt;<br><br>&lt;/project&gt;<br>-----------------------------------------------------------------------------
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tests/test.xml<br>-----------------------------------------------------------------------------<br>&lt;?xml version=&quot;1.0&quot;?&gt;<br><br>&lt;!DOCTYPE project [<br>&nbsp; &lt;!ENTITY config&nbsp;&nbsp; SYSTEM &quot;config.xml
&quot;&gt;<br>&nbsp; &lt;!ENTITY testVolontaire&nbsp;&nbsp; SYSTEM &quot;testVolontaire.xml&quot;&gt;<br>&nbsp; &lt;!ENTITY testRecrut&nbsp;&nbsp; SYSTEM &quot;testRecrut.xml&quot;&gt;<br>&nbsp; &lt;!ENTITY verif SYSTEM &quot;verif.xml&quot;&gt;<br>]&gt;<br>
<br><br>&lt;project name=&quot;test&quot; default=&quot;oneTest&quot; basedir=&quot;..&quot;&gt;<br>&nbsp;&nbsp;&nbsp; &lt;property name=&quot;webtest.home&quot; location=&quot;C:/canoo&quot; /&gt;<br>&nbsp;&nbsp;&nbsp; &lt;import file=&quot;${webtest.home
}/lib/taskdef.xml&quot;/&gt;<br>&nbsp;&nbsp;&nbsp; &lt;target name=&quot;oneTest&quot;&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;webtest name=&quot;$(test.Name)&quot;&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &amp;config;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;steps&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;ifStep description=&quot;if volontaire: $(
test.volontaire)&quot; test=&quot;$(test.volontaire)&quot;&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &amp;testVolontaire;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/ifStep&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;ifStep description=&quot;else&quot; unless=&quot;$(test.volontaire
)&quot;&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &amp;testRecrut;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/ifStep&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &amp;verif;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/steps&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/webtest&gt;<br>&nbsp;&nbsp;&nbsp; &lt;/target&gt;<br>&lt;/project&gt;<br>
----------------------------------------------------------------------------------------------------------------<br>properties/MyTest.properties<br>--------------------------------------------------------------------------------------------------------------
<br>page.volontaire=t.php<br>page.recrutement=t_recrut.php<br>page.test=test-form/test.html<br><br>test.Name=MyTest<br>test.volontaire=true<br>test.ResultOk=true<br>---------------------------------------------------------------------------------------------------------------
<br><br>the problem is that it doesn't care of my properties. for example it displaies:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [ifStep]&nbsp; INFO (com.canoo.webtest.steps.Step) - &gt;&gt;&gt;&gt; Start Step: ifStep &quot;if volontaire: $(test.volontaire
)&quot; (1/122)<br>it's the same for test.Name.<br>i'm pretty sure it doesn't come from the properties file because in testRecrut.xml, a property page.volontaire is used and works fine.<br><br>&nbsp;I don't understand where is the problem.
<br><br>&nbsp;thank you for your future answers<br><br>Julien Chambert<br><br><br>

------=_Part_92601_25672539.1158136620522--