Selenium-RC Unable to process confirmation window

I am testing a web application where I remove an item from a list. When you click on delete, the application asks for confirmation. The Selenium IDE defines it as a confirmation window. When I run the code in "RC" (C #), it even gets into the confirmation field, presses the delete button in this confirmation window, but the confirmation window never appears on the screen. In addition, he presses only the delete button; item is not deleted. I tried it manually, it works fine.

Please help, I am new to Selenium and tried to find answers in several forums without any success.

Here is 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");

, , . , , "Javascript:;" firefox. , javascript hrefs, selenium-rc.
,
Vamyip

+3
2

, - (, javascript). , IDE , . , , . , .

.


. , javascript . Selenium Javascript.

, .

,
Vamyip

+1

Source: https://habr.com/ru/post/1753236/


All Articles