# Capture delay and ON/OFF new page appearance

**URL:** <https://forum.robotframework.org/t/capture-delay-and-on-off-new-page-appearance/878>\
**Category:** Development\
**Created:** [28 October 2020 02:42 UTC](https://forum.robotframework.org/t/capture-delay-and-on-off-new-page-appearance/878 "2020-10-28T02:42:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![natK](https://avatars.discourse-cdn.com/v4/letter/n/46a35a/32.png) [@natK](https://forum.robotframework.org/u/natK)\
**Post date:** [28 October 2020 02:42 UTC](https://forum.robotframework.org/t/capture-delay-and-on-off-new-page-appearance/878/1 "2020-10-28T02:42:43Z")

</div>

Hi, I am trying to automate the following scenarios:  
After clicking on the “Send” button , there may be a delay of up to 5 seconds for the next page to appear, and then next page can be opened with:  
#1) Completed button or  
#2) 'We are processing ’ message and Cancel button or  
#3) message “Please wait” and there is no button … then this page can be replaced with page #1 or #2 or #4 …this is on/off process between all the pages . The timeout for this process is 30 seconds.  
#4) Process Failed message and an OK button.

I can complete the process for scenario # 1 or press the button for scenarios # 2 and # 4.  
The following code does not work for me if it is a delay when opening a new page or scenario # 3.  
Please advise how you can catch the delay when opening a new page and scenarios # 3?

{buttonCompleted} Run Keyword And Return Status Element Should Be Visible //scenario#1 Run Keyword If '{buttonCompleted}’==‘True’ Click Element //buttonCompleted  
… ELSE Click Element //button
