Timeout in Keywords and Test Cases doesent work with Browser keywords

Basically Browser library keywords simply dont care about the [Timeout] given in a Test Case or Keyword and will run even if it exceeds it.

I made an example here, it doesent matter what time value i give the [Timeout] the Click will always fail after 10 sec , which is the default browser timeout

*** Settings ***
Library    Browser

*** Test Cases ***
Timeout Test
    [Timeout]    8sec
    New Browser    chromium    headless=False
    New Context
    New Page    https://bing.com
    #Sleep    45sec
    Click    not_existing_selector

Here is the log:
Despite the Test Case Timeout is 8 sec, Click runs for 10sec and failed after:

But if i use a built in keyword (eg. Sleep) it works as expected and wont run over the given [Timeout]
Same with Keyword [Timeout]

Am I missing something? Or [Timeout] just simply doesent work with Browser library Keywords?

@aaltat I’m I right to believe that it doesn’t work because Browser Library has it’s own time-out mechanism?

Hi

Yes, you are correct, Browser library and all libraries that I can recall don’t use test timeout. Libraries generally have their own timeouts definitions.

-Tatu

1 Like