I am trying to automate my performance testing scenario on two different browser Edge and Chrome, since both scripts supports the JavaScript API's for performance.
The problem I am facing is my scenarios are different from one another, but this happen on the same session of web Browser.
For example, I need to measure the response time on opening a form which is first scenario, the second scenario would be response time taken for a form to save, both are two different scenarios but use same session of browser.
I am trying to use the following code once my first scenario is done
window.performance.timing.responseStart - window.performance.timing.responseEnd
here I get proper time 8 ms, post this I try to fill and save form which is my second scenario, and verify the response time like the above, I still get 8 ms which is not validate as the actual time took to save and reload the new form is more than 8 ms. When I check the individual response start and end time, they remain same for the entire session.
I want to calculate different response time for the form on save and reload. Is this feasible in First place? If so what is the better approach?