Sakke
Sakke

Reputation: 103

Robot Framework: Is there general setting for the Wait Until Element Is Visible

In the Robot Framework it is good to check that the element is loaded in the page with the

Wait Until Element Is Visible

keyword before using the element. I have implemented my own keywords:

Push
    [Arguments]    ${element}
    Wait Until Element Is Visible    ${element}    10
    Click Element    ${element}

Insert                                                                         
    [Arguments]    ${elementti}    ${text}
    Wait Until Element Is Visible    ${elementti}    10
    Input Text    ${elementti}    ${text}

I'm using these keywords like this:

Push    elementId
Insert    elementId    text

Is there general setting so I don't need my own keywords? There is general variable ${DELAY}, but (according to the documentation) with it all executed commands are delayed and the test takes too much time.

BR,

Sakke

Upvotes: 1

Views: 7826

Answers (1)

Bryan Oakley
Bryan Oakley

Reputation: 385970

As described in the documentation, you can set an implicit wait.

You can specify this when you load the library (by setting the implicit_wait option), or through the keyword Set selenium implicit wait).

However, this won't cause the application to wait for an element to be visible. It causes selenium commands to wait until an element is available in the DOM.

Upvotes: 2

Related Questions