I'm learning PHPUNIT
at the moment. It was getting interesting until i got stuck on something.
I "logged-in" it and went well,
But this PrintOut
just displays. Is there anyway I could remove it?
Actually I just want to get the value of the Surname, FirstName and the the picture most importantly, the picture.
The picture is saved as /ImagePage.aspx
. Is there a way in which I can download this and force close the browser because I don't know how to close the print Pop-out
The picture frame id is CandImg
This is my code:
<?php
class TestLogin extends PHPUnit_Extensions_Selenium2TestCase
{
public function setUp()
{
$this->setHost('localhost');
$this->setPort(4444);
$this->setBrowser('firefox');
$this->setBrowserUrl('http://localhost/tutor');
}
public function setSpeed($timeInMilliSec)
{
$this->setSpeed('120');
}
/*Function to locate website*/
public function testHasLoginForm()
{
$this->url('http://www.jamb.org.ng/DirectEntry/');/*This is the site*/
$username = $this->byId('ctl00_ContentPlaceHolder1_RegNumber');/*Search for a name*/
$this->assertContains('Reg.Number/PIN', $username->value());
##ctl00_ContentPlaceHolder1_txtRegNumber
$action = $this->byName('ctl00$ContentPlaceHolder1$Reprint')->attribute('action');
$this->byId('ctl00_ContentPlaceHolder1_RegNumber')->value('49003257DE');/*value of the textbox*/
$jump = $this->byName('ctl00$ContentPlaceHolder1$Reprint');
$this->byName('ctl00$ContentPlaceHolder1$Reprint')->click();
}
}
#to Save ImagePage.aspx
?>