setFieldByName() public method

Sets all form fields with that name. Will use label if one is available (not yet implemented).
public setFieldByName ( string $name, string $value, $position = false ) : boolean
$name string Name of field in forms.
$value string New value of field.
return boolean True if field exists, otherwise false.
<?php

require_once "vendor/autoload.php";
require_once "config.php";
$browser = new SimpleBrowser();
$page = $browser->get('http://freshcode.club/submit/qownnotes-test');
//var_dump( $page );
var_dump($browser->getFieldByName("description"));
var_dump($browser->setFieldByName('submitter', 'pbek'));
var_dump($browser->setFieldByName("version", "1.1"));
var_dump($browser->setFieldByName("changes", "lots of changes"));
var_dump($browser->setFieldByName('req[os]', '1'));
var_dump($browser->setFieldByName('req[cc]', '1'));
$page = $browser->clickSubmit('Submit Project/Release');
var_dump($page);
Example #2
0
<?php

require_once '../simpletest/browser.php';
$browser = new SimpleBrowser();
$browser->get('http://mentor-stereo.codio.io:3000/app/public/index.php/login');
$browser->setFieldByName('login', 'admin');
$browser->setFieldByName('login', 'admin');
$browser->clickSubmit('Log In');