How do I capture application response time
This example demonstrates how to capture application response time such as page load, DOM load, Time to first byte, load, etc., of a page.
In the solution shown below, you will see that the page load is captured in seconds by providing page load function and "S"(represents Seconds) separated by "||" using "runEventTimingFunction" command and the captured time is stored into a variable. By using "echoForReporting" command, the response time is pushed to the Transaction Detail Report.
Note: The notation to reuse the value of the variable in Worksoft SaaS is ${<Variable Name>}.
Solution:
# | Command | Target | Value |
---|---|---|---|
Capture the page load in Seconds | |||
1 | runEventTimingFunction |
pageload||S |
time |
Push captured response time into column "PageLoad" in the Transaction Detail Report | |||
2 | echoForReporting |
PageLoad |
${time} |
Tips, Tricks, Gotchas & Best Practices:
- You can use "runEventTimingFunction" command after performing any action(which invokes the page to load or navigate to another page).
- You can also capture the time in MS(represents Milli Seconds), M(represents Minutes) or H(represents Hours).
- You can use different functions in the Target field such as connect, dns, domcomplete, domload, dominteractive, fetch, load, redirect, timetofirstbyte, response, ssl, unload.