vendredi 10 août 2018

Robot Framework More efficient way to "Sleep"

I am using Robot Framework,

At the moment I have 5-10 test cases and i use sleep to wait for the page to fully load after clicking a button,

*** Variables ***

${Name} =  example name
${Next_Button} =  xpath=//*[@id="app"]/div/div[1]/div[3]/div/div/div[1]/div[2]/div/div/div/button[2]

*** Keywords ***
Open Tab
    Click Element  xpath=//*[@id="app"]/div/div[1]/div[1]/div[2]/nav/ul/li[2]/a
    Sleep  5s

Open Details
    Click Element  xpath=//*[@id="app"]/div/div[1]/div[3]/div/div/div[1]/div[2]/div/div[1]/img
    sleep  5s


Navigate to Room Details
    click button   xpath=//*[@id="app"]/div/div[1]/div[3]/div/div/div[1]/div[2]/div/div/button
    click button  ${Next_Button}
    click button  ${Next_Button}
    sleep  3s

When my tests increase to 100-200 it will take a lot of time to run them,

Whats a more efficient way of using Sleep, or a different keyword that would work for a lot of tests. My web app loads from 1-5 seconds.

Aucun commentaire:

Enregistrer un commentaire