RobotFramework脚本默认超时修改问题:Wait Until Element Is Visible超时异常
Wait Until Element Is Visible Ah, I’ve run into this exact frustration before! The issue here is that your 10-second timeout isn’t being picked up correctly, so the keyword is still falling back to the default 5-second window. Let’s walk through the fixes step by step:
1. Fix your parameter separation syntax
Robot Framework is pretty picky about how you split parameters, and your pipe-based syntax has a small but critical error.
If you want to use pipes, each parameter needs to be separated with | (a pipe followed by a space). Your original line Wait Until Element Is Visible | Locator| 10 misses that space after the pipe before 10—so Robot Framework is treating Locator| 10 as a single locator value instead of two separate parameters. That’s why it’s ignoring your timeout and using the default 5 seconds.
Correct pipe syntax:
Wait Until Element Is Visible | ${LOCATOR} | 10
That said, most Robot Framework users prefer using 2+ spaces to separate parameters—it’s more readable and avoids these parsing headaches. Here’s the same line with spaces:
Wait Until Element Is Visible ${LOCATOR} 10
2. Double-check your locator
Make sure Locator is a valid reference (like a variable ${LOCATOR} holding your actual locator string, e.g., id=submit-button). If the locator itself is wrong, the keyword will fail as soon as the default timeout hits, even if you set a longer one.
3. Make your timeout explicit (optional but clearer)
While plain numbers are interpreted as seconds by default, adding the s suffix removes any ambiguity and makes your test easier to read for others:
Wait Until Element Is Visible ${LOCATOR} 10s
4. Rule out global timeout overrides
If you’ve set a global Selenium timeout earlier in your test with Set Selenium Timeout, double-check that your explicit timeout is taking precedence (it should, but it’s worth confirming). For example:
Set Selenium Timeout 5s Wait Until Element Is Visible ${LOCATOR} 10s
The 10-second timeout should override the global 5-second setting for this specific keyword call. If it doesn’t, you might be on an older version of SeleniumLibrary—updating to v3.x or later should fix that.
Give these fixes a try, and your keyword should wait the full 10 seconds before timing out.
内容的提问来源于stack exchange,提问作者Chits

