<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Cloud Testing Blog &#187; cookie</title>
	<atom:link href="http://www.cloudtesting.com/blog/tag/cookie/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cloudtesting.com/blog</link>
	<description>Automated Functional, Cross Browser and Load Testing for Websites</description>
	<lastBuildDate>Fri, 23 Jul 2010 21:48:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>HOWTO: Cookie manipulation with Selenium and Cloud Testing</title>
		<link>http://www.cloudtesting.com/blog/2009/08/24/howto-cookie-manipulation-with-selenium-and-cloud-testing/</link>
		<comments>http://www.cloudtesting.com/blog/2009/08/24/howto-cookie-manipulation-with-selenium-and-cloud-testing/#comments</comments>
		<pubDate>Mon, 24 Aug 2009 14:45:38 +0000</pubDate>
		<dc:creator>Phil Smith - Cloud Testing</dc:creator>
				<category><![CDATA[Cloud Testing]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Selenium]]></category>
		<category><![CDATA[cookie]]></category>

		<guid isPermaLink="false">http://blog.cloudtesting.com/?p=680</guid>
		<description><![CDATA[As the Cloud Testing service uses Selenium RC, and real browsers such as Firefox, Internet Explorer, Safari, Chrome and Opera, cookie handling while running your test should be taken care of automatically. If however you want to do something special, you can override the default behaviour as follows: Create Cookie You can add cookies by [...]]]></description>
			<content:encoded><![CDATA[<p>As the Cloud Testing service uses Selenium RC, and real browsers such as Firefox, Internet Explorer, Safari, Chrome and Opera, cookie handling while running your test should be taken care of automatically. If however you want to do something special, you can override the default behaviour as follows:</p>
<h2>Create Cookie</h2>
<p>You can add cookies by using the ‘Create Cookie’ command.</p>
<p>The first argument is the name=value, e.g.</p>
<p>PHPSessionID=1213121</p>
<p>The second argument contain options for the cookie. Currenly ‘path’ and ‘max_age’ are supported.</p>
<p>The format is:</p>
<p>&#8220;path=/directory/, max_age=3600&#8243;</p>
<div id="attachment_681" class="wp-caption aligncenter" style="width: 545px"><img class="size-full wp-image-681" title="Create Cookie example" src="http://cloudtesting.files.wordpress.com/2009/08/cookies1.png" alt="cookies1" width="535" height="70" /><p class="wp-caption-text">Create Cookie example</p></div>
<p style="text-align:center;">For example:</p>
<h2>Delete Cookie</h2>
<p>Cookies can also be deleted using the &#8216;Delete Cookie&#8217; command. This take the cookie name as the first argument and the path as the second.</p>
<div id="attachment_686" class="wp-caption aligncenter" style="width: 545px"><img class="size-full wp-image-686" title="Delete Cookie example" src="http://cloudtesting.files.wordpress.com/2009/08/cookies3.png" alt="Delete Cookie example." width="535" height="32" /><p class="wp-caption-text">Delete Cookie example.</p></div>
<h2>Full Example</h2>
<p>In the following example, we visit a page, from which we get some cookies set by the server, we then add two cookies of our own, before deleting one of them.</p>
<div id="attachment_682" class="wp-caption aligncenter" style="width: 610px"><img class="size-full wp-image-682" title="Script with cookie create / delete" src="http://cloudtesting.files.wordpress.com/2009/08/cookies2.png" alt="Script with cookie create / delete" width="600" height="255" /><p class="wp-caption-text">Script with cookie create / delete</p></div>
<p>When we run the test, we get the following results:</p>
<div id="attachment_690" class="wp-caption aligncenter" style="width: 610px"><img class="size-full wp-image-690" title="Results of a test run" src="http://cloudtesting.files.wordpress.com/2009/08/cookies61.png" alt="Results of a test run" width="600" height="867" /><p class="wp-caption-text">Results of a test run</p></div>
<p>You are always able to view the cookies on any step that has interaction with the web server. After we have visited the page at step 1, we have the following cookies set:</p>
<div id="attachment_683" class="wp-caption aligncenter" style="width: 413px"><img class="size-full wp-image-683" title="Original cookies - set by server" src="http://cloudtesting.files.wordpress.com/2009/08/cookies4.png" alt="Original cookies - set by server" width="403" height="65" /><p class="wp-caption-text">Original cookies - set by server</p></div>
<p>After we set our own cookies at step 3 and 4 (CT and CT2), the next server interaction results in us having the following cookies set:</p>
<div id="attachment_684" class="wp-caption aligncenter" style="width: 363px"><img class="size-full wp-image-684" title="After manually added cookies" src="http://cloudtesting.files.wordpress.com/2009/08/cookies5.png" alt="After manually added cookies" width="353" height="79" /><p class="wp-caption-text">After manually added cookies</p></div>
<p>Note that the original cookies are still set, any new ones are just added.</p>
<p>In step 7 we delete one of the cookies we added (CT), we are left with the original ones from the server plus CT2:</p>
<div id="attachment_692" class="wp-caption aligncenter" style="width: 362px"><img class="size-full wp-image-692" title="After deleting the manual cookie CT" src="http://cloudtesting.files.wordpress.com/2009/08/cookies7.png" alt="After deleting the manual cookie CT" width="352" height="75" /><p class="wp-caption-text">After deleting the manual cookie CT</p></div>
<p>For full details of the services and features available from Cloud testing see <a href="http://www.cloudtesting.com/">www.cloudtesting.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cloudtesting.com/blog/2009/08/24/howto-cookie-manipulation-with-selenium-and-cloud-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
