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', 'asher@wds-testing.com');
$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 imageField2
isn't submit
but image
. Function ClickSubmitByName()
searches for inputs of type submit
(Your input code is <input type="image" border="0" name="imageField2" src="v/vspfiles/templates/240/images/buttons/btn_login.gif">
). You can use ClickImageByName()
instead.