2012-01-11 36 views
0

我想要確認一個使用C#的Selenium RC中彈出的對話框。我在Selenium IDE中記錄了我的步驟,並將其輸出到C#(RC)。代碼的重要部分如下: selenium.Click(「id = editCustomerForm:tbl_registrations:0:disableRegistrationCmdImg」); Assert.AreEqual(「undefined」,selenium.GetConfirmation());對話框確認不能在Selenium RC中使用C#

腳本總是失敗的 「Assert.Are ...」,出現以下錯誤信息行:

SeleniumTests.test.TheTestTest: Selenium.SeleniumException:ERROR:命令執行失敗。請在https://groups.google.com/forum/#!forum/selenium-users的用戶組中搜索日誌窗口中的錯誤詳細信息。錯誤信息是:結果未定義

當我在IDE(click和assertConfirmation)中運行相同的兩個命令時,它正在工作。有人可以幫忙嗎?

謝謝!

回答

0

只需嘗試調用函數selenium.GetConfirmation()接受模態消息。 不要使用Assert.AreEqual

+0

已經嘗試過。我試過Console.Write(selenium.GetConfirmation);該代碼在相同的錯誤消息在該行失敗。 – 2012-01-12 08:48:55

+0

我也嘗試過使用JUnit,並且出現相同的錯誤。也許這是我測試的Web應用程序出錯。 – 2012-01-12 14:30:54