0

In a test case is used the keyword sleep 2s and this is obviously too slow, so i would like to replace with the wait keyword.

Thing is, that it is used for a download. So the user downloads a file and then is used the sleep 2s in order to give some time to the Robot Framework to complete the download.

But I cannot use

wait until element is visible, wait until page contains, or wait until page contains element

because nothing changes on the page :/

Any ideas? How you handle this?

Thank you in advance!

  • How do you see that the file is already downloaded? – Psytho Jul 18 '16 at 09:30
  • And what do you mean saying "too slow"? – Psytho Jul 18 '16 at 09:32
  • usually the waiting moments are about 300ms-500ms so 2s is bigger amount of time and probably not necessary. I see it on my browser manually eg firefox has the error showing down marked as blue. Or on Chrome, on the bar at the bottom. But I have no idea how to capture such action with Robot :/ – Eftychia Thomaidou Jul 18 '16 at 09:37
  • Why don't you use `sleep 500ms` or `sleep 1s`? – Psytho Jul 18 '16 at 09:38
  • I want to avoid `sleep`, for example see the Avoid Sleeping in herE: [link](https://github.com/robotframework/HowToWriteGoodTestCases/blob/master/HowToWriteGoodTestCases.rst#avoid-sleeping) – Eftychia Thomaidou Jul 18 '16 at 09:55
  • 1
    take a look here http://stackoverflow.com/questions/35297958/robot-framework-download-file – Psytho Jul 18 '16 at 10:00
  • But I also don't know how much to wait for a download 'cause it depends on internet connection & size of the file – Eftychia Thomaidou Jul 18 '16 at 10:00

1 Answers1

1

You could use the keyword of wait until keyword succeedsand just keep repeating the next keyword you want to use until the download is done. Or you could set the implicit wait time to be higher so the webdriver waits for an implicit amount of time before it executes another keyword.

Justin Wilkins
  • 341
  • 2
  • 15