Hi,  

Thanks Marc for ur response,  

The issue was the authentication was not happening properly and so the 
JSESSIONID canoo was setting was not authenticated and hence all the test cases 
was failing. Once i fix the auth issue its working fine without setting the 
cookie it works fine now. Sorry for the trouble.

                 var autoCompleter = new Ajax.Autocompleter(                  
'cityName1', 'cityAutoComplete',                   
'/artist/ajax/autocomplete/cityCenterAndStateByCityName.do',                  { 
                  paramName: 'cityName',                   method: 'post',      
              parameters: 'limit=10',                   afterUpdateElement: 
function(){afterUpdateElement(1);},                   idField: $('cityId1'),    
               backupValue: 'Boscobel, WI'                  });                 
cityAutoCompleter[cityAutoCompleter.length] = autoCompleter;                 
cityNameFieldList[cityNameFieldList.length] = $('cityName1');  For prefilling 
the city name type.  How can i test this using webtest canoo, i tried filling 
the text input what                  I have another query though, this is 
regarding AJAX testing , I have a scenario where we take in the input and 
prefill the input field something similar to google suggest the code is:

<input type="hidden" name="fanBaseGoal.fanBaseCityIds" value="33253" 
id="cityId1">
                                                  <input type="text" 
name="fanBaseGoal.fanBaseCities" value="Boscobel, WI" onblur="return 
checkFanBaseCityField(1);" id="cityName1" class="inputtextLong">
                                                    <script 
type="text/javascript">
                                                        var autoCompleter = new 
Ajax.Autocompleter('cityName1', 
'cityAutoComplete','/artist/ajax/autocomplete/cityCenterAndStateByCityName.do',
                                                                    {
                                                                        
paramName: 'cityName',
                                                                        method: 
'post', 
                                                                        
parameters: 'limit=10',
                                                                        
afterUpdateElement: function(){afterUpdateElement(1);},
                                                                        
idField: $('cityId1'),
                                                                        
backupValue: 'Boscobel, WI'
                                                                    });
                                                                
cityAutoCompleter[cityAutoCompleter.length] = autoCompleter;
                                                                
cityNameFieldList[cityNameFieldList.length] = $('cityName1');
                                                </script> 

So once the user types some part of city name we list a drop down of city names 
matching the character typed and than user has to select from that list. 

Please can u provide some pointers on this,

Thanks & Regards,
-Amit 

----- Original Message ---- From: amit shrivas  To: [email protected] 
Sent: Sunday, March 18, 2007 10:55:31 PM Subject: Re: How to set JESSIONID 
cookie header after storing cookie..  Hi,  I tried using:  What I did in order 
to solve similar problems was to set the cookie header on the config element. 
Here is an example:     =20       =20      As:  In my login flow I  Set:        
                        This is my config.xml:          And this is one 
testcase i am using:  
               &config;              &login;                                    
                                     &defineGoals;                             
In defineGoals i check the property:     The verifyProperty passes, but the 
cookie is not set in CONFIG.xml or even in the config xml used directly.  
Please provide some insight, i am stuck.  Thanks in Advance, Amit     ----- 
Original Message ---- From: amit shrivas  To: [email protected] Sent: 
Saturday, March 17, 2007 3:45:17 AM Subject: Re: How to set JESSIONID cookie 
header after storing cookie..  Hi Marc,  Thanks for ur response, actually i am 
not able to set it even once, the one i have shown in config.xml i have cut 
pasted the JSESSIONID from my browser and using it, so its manually done by me 
after login in web application thru firefox.   I want to set it once in webtest 
after login and then use it across.   How is it possible to set cookie in 
webtest ?  -Amit   Hi Amit,  why do you want to set the cookie
 again? Once set, cookies are available through the whole  and will be used in 
further requests.  ----- Original Message ---- From: amit shrivas   To: 
[email protected] Sent: Friday, March 16, 2007 3:06:51 AM Subject: How to 
set JESSIONID cookie header after storing cookie..  Hi,  I am testing a web 
application and storing cookie after login as:     Verification is also done 
properly, now i want to set this cookie in header something like     So that i 
can run a set of test cases on subsequent pages with this session, how can i 
achieve this ?  I was looking at      Option but this in documents it says: The 
name of the Http Response  Header of interest. If the property name is not 
specified, the header name is used as key to store the value found. this i 
think is more on HTTP response header.   Please help, since i tried lot of 
different options and failed.  -Amit       We won't tell. Get more on shows you 
hate to love (and love to hate): Yahoo! TV's Guilty Pleasures
 list.       Don't be flakey. Get Yahoo! Mail for Mobile and  always stay 
connected to friends.       Bored stiff? Loosen up... Download and play 
hundreds of games for free on Yahoo! Games.   

 
---------------------------------
We won't tell. Get more on shows you hate to love
(and love to hate): Yahoo! TV's Guilty Pleasures list.
Hi,

Thanks Marc for ur response,
The issue was the authentication was not happening properly and so the JSESSIONID canoo was setting was not authenticated and hence all the test cases was failing. Once i fix the auth issue its working fine without setting the cookie it works fine now.

I have another query though, this is regarding AJAX testing , I have a scenario where we take in the input and prefill the input field something similar to google suggest the code is:

<input type="hidden" name="fanBaseGoal.fanBaseCityIds"
 value="33253" id="cityId1">
<input type="text" name="fanBaseGoal.fanBaseCities" value="Boscobel, WI" onblur="return checkFanBaseCityField(1);" id="cityName1" class="inputtextLong">
<script type="text/_javascript_">
var autoCompleter = new Ajax.Autocompleter(
'cityName1', 'cityAutoComplete',
'/artist/ajax/autocomplete/cityCenterAndStateByCityName.do',
{
paramName: 'cityName',
method: 'post',
parameters: 'limit=10',
afterUpdateElement: function(){afterUpdateElement(1);},
idField: $('cityId1'),
backupValue: 'Boscobel, WI'
});
cityAutoCompleter[cityAutoCompleter.length] = autoCompleter;
cityNameFieldList[cityNameFieldList.length] = $('cityName1');

For prefilling the city name type.

How can i test this using webtest canoo, i tried filling the text input what
</script>



----- Original Message ----
From: amit shrivas <[EMAIL PROTECTED]>
To: [email protected]
Sent: Sunday, March 18, 2007 10:55:31 PM
Subject: Re: How to set JESSIONID cookie header after storing cookie..

Hi,

I tried using:

What I did in order to solve similar problems was to set the cookie
header on the config element.
Here is an example:

<config
host=3D"${admin.host}"
port=3D"${admin.port}"
protocol=3D"http"
summary=3D"true"
saveresponse=3D"true"
verbose=3D"true"
resultpath=3D"C:\webtest\tests\results"=20
resultfile=3D"report.xml"=20
autorefresh=3D"true"
haltonfailure=3D"false"
haltonerror=3D"false"=20
showhtmlparseroutput=3D"true">
=20
<header name=3D"Cookie" value=3D"JSESSIONID=3D${sessioncookie};
space_user=3D${space_user}"/>
=20
</config>

As:

In my login flow I Set:

<storeCookie name="JSESSIONID" property="dcookie" />

<verifyCookie name="JSESSIONID" text="#{dcookie}" />

<storeProperty
        description="convert dynamic to Ant"
        name="cookie"
        propertyType="ant"
        value="JSESSIONID=#{dcookie}"/>
       
<verifyProperty description="Verify ant property antProp contains the word 'Warning'"
      name="cookie"
      propertyType="ant"
      text=".*JSESS.*"
      regex="true" />     
       
This is my config.xml:

<config
  host="localhost"
  port="80"
  protocol="http"
  basepath="artist"
  summary="true"
  saveresponse="true"
  showhtmlparseroutput="true"
  haltonfailure="false"
  resultpath="/root/projects/canoo/webtest_indie/results"
>

<option name="IgnoreOutsideContent" value="false"/>

<header name="Cookie" value="${cookie}"/>

</config>

And this is one testcase i am using:

<project name="loginAndStep" default="case" basedir="..">
  <target name="case">
    <webtest name="loginAndStep">
      &config;
      <steps>
      &login;     
      </steps>
    </webtest>
    <webtest name="loginAndStep">
    <config
      host="stage.indiemarketer.net"
      port="80"
      protocol="http"
      basepath="artist"
      summary="true"
      saveresponse="true"
      showhtmlparseroutput="true"
      haltonfailure="false"
      resultpath="/root/projects/canoo/webtest_indie/results"
    >
   
    <option name="IgnoreOutsideContent" value="false"/>
   
    <header name="Cookie" value="${cookie}"/>
   
    </config>

      <steps>
      &defineGoals;     
      </steps>
    </webtest>   
  </target>
</project>

In defineGoals i check the property:

<verifyProperty description="Verify ant property antProp contains the word 'Warning'"
      name="cookie"
      propertyType="ant"
      text=".*JSESS.*"
      regex="true"
      />


The verifyProperty passes, but the cookie is not set in CONFIG.xml or even in the config xml used directly.

Please provide some insight, i am stuck.

Thanks in Advance,
Amit



----- Original Message ----
From: amit shrivas <[EMAIL PROTECTED]>
To: [email protected]
Sent: Saturday, March 17, 2007 3:45:17 AM
Subject: Re: How to set JESSIONID cookie header after storing cookie..

Hi Marc,

Thanks for ur response, actually i am not able to set it even once, the one i have shown in config.xml i have cut pasted the JSESSIONID from my browser and using it, so its manually done by me after login in web application thru firefox.

I want to set it once in webtest after login and then use it across.

How is it possible to set cookie in webtest ?

-Amit

Hi Amit,

why do you want to set the cookie again? Once set, cookies are available
through the whole <webtest> and will be used in further requests.

----- Original Message ----
From: amit shrivas <[EMAIL PROTECTED]>
To: [email protected]
Sent: Friday, March 16, 2007 3:06:51 AM
Subject: How to set JESSIONID cookie header after storing cookie..

Hi,

I am testing a web application and storing cookie after login as:

<storeCookie name="JSESSIONID" property="cookie" />
<verifyCookie name="JSESSIONID" text="#{cookie}" />

Verification is also done properly, now i want to set this cookie in header something like

<header name="Cookie" value="JSESSIONID=4EA91ED4FEF3245652F40FEC887B6B8C"/>

So that i can run a set of test cases on subsequent pages with this session, how can i achieve this ?

I was looking at

 <storeHeader description="store cookie"   name="Content-Type" property="contentType" />

Option but this in documents it says: The name of the Http Response Header of interest. If the property name is not specified, the header name is used as key to store the value found. this i think is more on HTTP response header.

Please help, since i tried lot of different options and failed.

-Amit


We won't tell. Get more on shows you hate to love
(and love to hate): Yahoo! TV's Guilty Pleasures list.



Don't be flakey. Get Yahoo! Mail for Mobile and
always stay connected to friends.



Bored stiff? Loosen up...
Download and play hundreds of games for free on Yahoo! Games.

Reply via email to