I use Recorder Addon in Firefox.
I have this:
waitForElementPresent //input[@id=‘download’]
This does never trigger, it waits forever. But if I manually execute the next line that line works:
click //input[@id=‘download’]
I need to wait because I did not find a way to tell the recorder to wait longer by default (creating the downloadable file takes a while). The page refreshes until the file is ready, on that refresh the download button appears.
However, the JUnit test that is created works! It creates this:
for (int second = 0;; second++) {
if (second >= 60) fail("timeout");
try { if (isElementPresent(By.xpath("//input\[@id='download'\]"))) break; } catch (Exception e) {}
Thread.sleep(1000);
}