I have installed Selenium IDE on Firefox and manage to record and play various web navigation sequences. What I need is to do it all automated through PHP, i.e. run a PHP script which gets the HTML source of the final page (i.e. at end of navigation sequence). Within Selenium there is an option to export to PHP, so I get something like:
class Example extends PHPUnit_Extensions_SeleniumTestCase
{
function setUp()
{
$this->setBrowser("*chrome");
$this->setBrowserUrl("http://www.example.com/");
}
function testMyTestCase()
{
$this->open("/");
$this->click("link=24");
$this->waitForPageToLoad("30000");
$this->click("link=Test2");
$this->waitForPageToLoad("30000");
$this->click("//td[4]/a/img");
$this->waitForPageToLoad("30000");
$this->type("username", "user");
$this->type("password", "pass");
$this->click("//input[@name='login']");
$this->waitForPageToLoad("30000");
}
}
Benim PHP kodu kullanabilirsiniz rağmen (sanırım sadece bir sınıf tanımı beri), bir şey yapmak için görünmüyor. Nasıl bu son kaynak sayfa alabilirim? Yerine ben zaman içinde PHP ayrıca bu son kaynak kodunu işlemek istiyorum, benim PHP kodu ekranda navigasyon yapmak istemiyorum unutmayın.