I am trying to find a way to set the page load timeout or something similar.
In Python it looks like this:
driver = webdriver.Chrome(r'C:\Users\webdrivers\chromedriver.exe')
driver.set_page_load_timeout(1)
I found the [Timeout] that works well but, I can not catch the error and it resumes the execution.
I would like to write something like that:
*** Keywords ***
Load Page
[Arguments] ${url}
Set Selenium Page Load Timeout 20 seconds
Open Available Browser ${url}
Log To Console
… The url: ${url} Succeeded to load
[Teardown] Log If Fails ${url}
*** Keywords ***
Log If Fails
[Arguments] ${url}
IF '${KEYWORD_STATUS}' == 'FAIL'
Log To Console The url: ${url} Failed to load
END
*** Tasks ***
@{list}= Create List
… http://localhost:8011/timeout/10
… http://localhost:8011/timeout/30
… http://localhost:8011/timeout/10
FOR ${url} IN @{list}
Run Keyword And Continue On Failure Load Page ${url}
END
Log To Console
… The task finish the execution
[Teardown] Close All Browsers
And I expect to see printed in the console:
The url: http://localhost:8011/timeout/10 Succeeded to load
The url: http://localhost:8011/timeout/30 Failed to load
The url: http://localhost:8011/timeout/10 Succeeded to load
The task finish the execution
Is there any solution or workaround for that?
Thanks in advance!!