1

私のセットアップは次のようなものです:

  1. 最新の Selenium サーバー
  2. 最新の Phpunit および Selenium プラグイン
  3. Firefox 3.6 (Selenium IDE でなくてもプラグインはインストールされません)

わかりました最後に私のコードは次のようになります:

<?php
class TestLogin extends PHPUnit_Extensions_Selenium2TestCase
{
    public function setUp()
    {
        $this->setHost('localhost');
        $this->setPort(4444);
        $this->setBrowser('firefox');
        $this->setBrowserUrl('http://localhost');
        $this->prepareSession();
        $this->url('http://localhost');
    }

    public function testSignupFormFor()
    {
         $this->url('http://localhost/ci/index.php/signup/signupController/signup');

         $div = $this->byCssSelector('div#signupFormId');
         $form =$this->byCssSelector('div#signupFormId>form');
         $userObj = $this->byName("userName");

         $userName = $userObj->value('root');   -----> Server hangs here

         $this->assertEquals('root',$userName);
?>

phpunit filename.php でコードを実行すると、Firefox が開き、メッセージが表示されてハングします

サーバーのログを見ると、このようになっています

16:55:36.608 INFO - Executing: [send keys: 2 org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWebEleme
nt@8e7c2cfc, [r, o, o, t]] at URL: /session/b0da54ee-6029-4ff6-b0b7-2d9b44cbb81c/element/2/value)
16:56:36.631 INFO - Executing: [delete session: b0da54ee-6029-4ff6-b0b7-2d9b44cbb81c] at URL: /session/b0da54ee-6029-4ff
6-b0b7-2d9b44cbb81c)

誰でも私を助けることができますか?

4

0 に答える 0