diff --git a/tests/auto/quick/dialogs/tst_dialogs.cpp b/tests/auto/quick/dialogs/tst_dialogs.cpp
index ecc2764fde0971dfabbc125f941ce437a2805f07..d4846a9d0482e469d85963507ee762c6c3fe47c1 100644
--- a/tests/auto/quick/dialogs/tst_dialogs.cpp
+++ b/tests/auto/quick/dialogs/tst_dialogs.cpp
@@ -218,6 +218,7 @@ void tst_Dialogs::javaScriptDialogRequested()
     QCOMPARE(dialog->type(), type);
     QCOMPARE(dialog->message(), message);
     QCOMPARE(dialog->defaultText(), defaultText);
+    QTRY_VERIFY(m_listner->ready()); // make sure javascript executes no longer
 }
 
 #include "tst_dialogs.moc"