2011-07-07 18 views
0

私は、Selenium jarファイルを使用してEclipseでjavaプロジェクトを作成しました。 私は、Javaの例外エラー取得していますJUnitテストを実行している間:Selenium RC Java例外の問題

パッケージcom.example.testsを。

import com.thoughtworks.selenium。*;

import java.util.ArrayList; import java.util.HashMap; import com.infy.csvUtil.CSVFileReader;

パブリッククラスの作成がSeleneseTestCaseを拡張{ 公共ボイドセットアップ()は、例外{ セットアップをスロー( "http://14.126.220.15:84333/"、 "*のFirefox")。 }

public void Creationv2() throws Exception { 

    try { 
     selenium.open("CCC/CEP?REQUEST=SIGNONREQ"); 
    } catch (Exception e) { 
     e.printStackTrace(); 
    } 
    selenium.selectWindow(null); 
    assertEquals("Selected panel window", selenium.getTitle()); 
    selenium.type("SignonUserName", "sssss"); 
    selenium.type("SignonPassword", "fewere"); 
    selenium.click("button1"); 
    if (selenium.isAlertPresent()) { 
     selenium.getAlert(); 
    } 

実行している間、私は次のエラーを取得しています:

* * Java.lang.Assertionexception:予想される "選択したパネルウィンドウ" が、代わりに "" を見ました。次の文のための

答えて

0

アサーションに失敗しました。

assertEquals("Selected panel window", selenium.getTitle()); 

次の文を使用してタイトルを印刷し、それが期待されるタイトル(すなわち、「選択したパネルウィンドウ」)とのマッチングされているかどうかを確認してみ

System.out.println("Title -> "+selenium.getTitle());