mercredi 15 juillet 2015

Selenium Wait for element works only when debug selected test

I have webpage built using ajax. In code there is a method:

public static void ProceedButtonClick()
{
    Driver.WaitForAndIsEnabledFind(ProceedButtonElementBy).Click();
    Driver.WaitFor(LoadedPageFinishedIdentifierBy);
}

As you can see I only click and later wait for next window to show. When I run this code by 'run selected test' test freezes at wait and gets time outed. But the window is visible on the page. I can see it in a browser. If I run this code by 'debug selected test' everything works. I don't even need to put breakpoints. Debug mode is enough. Selectors are ok. I double checked them. Here is my WaitFor method:

public static void ProceedButtonClick()
{
    Driver.WaitForAndIsEnabledFind(ProceedButtonElementBy).Click();
    Driver.WaitFor(LoadedPageFinishedIdentifierBy);
}

Aucun commentaire:

Enregistrer un commentaire