<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to 19: submitFormByID - fetch the next page</title><link>https://sourceforge.net/p/simpletest/support-requests/19/</link><description>Recent changes to 19: submitFormByID - fetch the next page</description><atom:link href="https://sourceforge.net/p/simpletest/support-requests/19/feed.rss" rel="self"/><language>en</language><lastBuildDate>Wed, 22 Apr 2009 05:37:55 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/simpletest/support-requests/19/feed.rss" rel="self" type="application/rss+xml"/><item><title>submitFormByID - fetch the next page</title><link>https://sourceforge.net/p/simpletest/support-requests/19/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Hello. I am trying to automate our website registration and I need some help regarding fetching the next page after submitting the form. Here's the situation:&lt;/p&gt;
&lt;p&gt;registration page: &lt;a href="http://localhost/unit_testing/accounts/register" rel="nofollow"&gt;http://localhost/unit_testing/accounts/register&lt;/a&gt;&lt;br /&gt;
method=POST; action=same URL as above but with different contents if the registration is successful.&lt;/p&gt;
&lt;p&gt;So after filling up all the required fields (using simpletest of course) and submitting the form, is there a way to fetch the succeeding page automatically? I have done this but failed, and got the main registration page, despite the fact that the registration is successful. Here's my code:&lt;/p&gt;
&lt;p&gt;$some_textbox_variable = 'some textbox values';&lt;/p&gt;
&lt;p&gt;$this-&amp;gt;get('http://localhost/unit_testing/accounts/register');&lt;/p&gt;
&lt;p&gt;if ($this-&amp;gt;assertText('some registration page text'))&lt;br /&gt;
{&lt;br /&gt;
$this-&amp;gt;assertTrue($this-&amp;gt;setFieldbyName('some_textbox_name', $some_textbox_variable));&lt;/p&gt;
&lt;p&gt;$this-&amp;gt;assertTrue($this-&amp;gt;submitFormById('RegisterForm'));&lt;br /&gt;
$this-&amp;gt;getUrl();&lt;/p&gt;
&lt;p&gt;if ($this-&amp;gt;assertText('Registered')) //'Registered' is a text displayed if the registration is successful.&lt;br /&gt;
{ echo '&amp;lt;br&amp;gt; Success &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;';}&lt;br /&gt;
else&lt;br /&gt;
{echo '&amp;lt;br&amp;gt; Error &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;';}&lt;br /&gt;
;&lt;br /&gt;
;&lt;br /&gt;
}&lt;br /&gt;
;&lt;/p&gt;
&lt;p&gt;And when I replace $this-&amp;gt;getUrl(); with $this-&amp;gt;get('http://localhost/unit_testing/accounts/register, it fetches the main registration page and not the "registration complete" page (again, both are under the same URL).&lt;/p&gt;
&lt;p&gt;I hope somehow I made myself clear. Any help would be appreciated. Thank you.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Daryle Dakis</dc:creator><pubDate>Wed, 22 Apr 2009 05:37:55 -0000</pubDate><guid>https://sourceforge.net1f4a6513795889ed21e97eb4db2c0bf0044c6ac7</guid></item></channel></rss>