带秒表的跟踪性能机器人框架

Track Performance Robot Framework with stopwatch

我想跟踪 Robot Framework 和 Selenium2Library 的性能。当我点击一个元素时,秒表必须在页面准备好时停止计数。可能吗?我知道 DateTime 库并尝试了一些但它不起作用。

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

${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 元素或其他一些标准。