用秒表跟踪性能机器人框架

时间:2016-01-26 08:16:28

标签: performance selenium robotframework

我想通过Robot Framework& amp; Selenium2Library。当我点击一个元素时,秒表必须在页面准备就绪时计数。可能吗?我知道DateTime库并尝试了一些东西,但它不起作用。

1 个答案:

答案 0 :(得分:3)

这是一个简单的例子,它测量页面加载一些不同元素的时间:

${start} =  Get Current Date
Open Browser    https://ixquick.com/
Wait Until Page Contains Element    //input[@id='query']
${stop} =   Get Current Date
${diff} =   Subtract Date From Date     ${stop}     ${start}
Log    ${diff}

您需要Selenium2LibraryDateTime库来运行它。根据您的需要进行调整,即您必须找到的ready 定义。这可能是一些HTML元素或其他一些标准。