Cannot find element after RELOAD PAGE

Hi all,

I want to reload a page within a loop until an element appears. Unfortuately the element cannot be found after RELOAD PAGE keyword. If the element is there before RELOAD PAGE the element can be found. There is no StaleElementException or something similar. The page does not use iFrames or Hidden Dom.
Here is the code:
Wait For Document In Inbox
[Documentation] Waits until at least one document is visible
${document_number}= GET ELEMENT COUNT ${INBOX_DOCAREA_FIRST_DOC}
LOG Number of documents: ${document_number}
RETURN FROM KEYWORD IF ${document_number} > 0

FOR    ${counter}    IN RANGE    30
    SLEEP    5
    RELOAD PAGE
    ${document_number}=    GET ELEMENT COUNT    ${INBOX_DOCAREA_FIRST_DOC}
    LOG    Number of documents: ${document_number} 
    IF    ${document_number} > 0
        LOG    returning
        RETURN FROM KEYWORD
    END
END

Thanks for your help

1 Like

I would try adding a wait after the page load as there is likely time between the page loading and when the page is rendered and the elements are there.

1 Like