After setting up automated tests using selenium, I aim to display a message box informing testers about the launched test.
It is crucial that the test execution halts when the messagebox appears and resumes once it is closed.
To achieve this, I utilized JavaScript:
Object result = ((JavascriptExecutor)TestRunner.driver).executeScript("alert('" + text + "');");
Now, I want the message box to remain visible for a few seconds. I attempted:
TestRunner.driver.manage().wait(10);
And
Selenium selenium = new WebDriverBackedSelenium(TestRunner.driver, TestRunner.driver.getCurrentUrl());
selenium.start();
selenium.getConfirmation();
And
WebDriverWait waitForOkay = new WebDriverWait(TestRunner.driver, 10);
waitForOkay.wait(10);
However, the alert always disappears immediately, as if there is an
alert.accept();
Is there a way to have a messagebox that either requires clicking "Ok" or disappears after a timeout (e.g., 10 seconds) without disrupting the automated tests?
Any suggestions or alternative methods are greatly appreciated!