Hi,
I am testing a web app where i delete an item from a list. Upon clicking on delete, the app asks for confirmation. Selenium IDE detects it as a confirmation box. When I run the code thro' the RC (C#), it even catches the confirmation-box, executes the click of delete button on that confirmation box, but, the confirmation box is never visible on the screen. Further, it only clicks on the delete button; the item doesn't get deleted. I tried it manually, works fine.
Please help, I'm new to Selenium and tried to find the answers at multiple forums without any success.
Here's the code:
string confirmation;
for (int second = 0;; second++) {
if (second >= 60) Assert.Fail("timeout");
try
{
confirmation=selenium.GetConfirmation();
if ((confirmation == " Delete confirmation message")) break;
}
catch (Exception e)
{
PrintLog("Error while waiting for confirmation. Error: "+e.Message);
}
Thread.Sleep(1000);
}
try
{
Assert.IsTrue(confirmation == "Delete confirmation message");
}
catch (AssertionException e)
{
PrintLog(e.Message);
}
selenium.FireEvent("//a[@id='btnOkConfirm']","click");
After the last statement, the selected item must get deleted and page should refresh, but, nothing happens. All I can see is "Javascript:;" written in the status bar of the firefox window. I guess its problematic to get javascript hrefs working in selenium-rc.
Thanks,
Vamyip