Search code examples
seleniumwaitrobotframework

Robot framework Wait until page does not contain takes 15 seconds


I'm trying to use the Robot Framewrok function Wait Until Page Does Not Contain, but no matter what timeout i set - it always waits for 15 seconds. With function Page should not contain it's even worse - 30 seconds.

For example

Wait Until Page Does Not Contain     x     5s

When function fails it says: The text x didn't disappear in 5 seconds. But it takes 15 seconds to finish

I've tried with Set selenium timeout and written something like this

Wait until page doesnt contain
    [Arguments]    ${text}
    Wait Until Keyword Succeeds     2s      1s      page should not contain     ${text}

But it always takes longer than expected

Where's the problem?


Solution

  • I managed to omit this problem by writing keyword

    Page shouldnt contain
        [Arguments]    ${text}
        ${pageSource} =  get source
        should not contain  ${pageSource}   ${text}
    

    Easy, but not so obvious