I am trying to login to a website using simpleTest browser.
Below is my code
require_once('simpletest/browser.php');
$browser = new SimpleBrowser();
$browser->get('http://uosom.dzxpy.servertrust.com/login.asp');
$browser->setField('email', '[email protected]');
$browser->setField('password', 'password123');
echo $browser->clickSubmitByName('imageField2');
It is not logging me in and even it does not throw an error.
Can anyone please tell me what I am doing wrong?
It is beacuse the type of
imageField2isn'tsubmitbutimage. FunctionClickSubmitByName()searches for inputs of typesubmit(Your input code is<input type="image" border="0" name="imageField2" src="v/vspfiles/templates/240/images/buttons/btn_login.gif">). You can useClickImageByName()instead.