Anyone using appium to measure load time of different pages of app?

I am working on an app which has 4 pages. On first page there is a search feature. I can search for different inputs on this search bar to reach to second page.

I want to measure page load time for various inputs. And I’m trying to automate this using Appium.

Here are the steps I perform:

  1. Enter search parameters.
  2. Start Timer - Identify Submit button - Stop Timer - Calculate time difference->> A
  3. Start Timer - Click Submit Button - Check existence of an item on 2nd page - Stop as soon as it finds it -->> Calculate time difference->> B
  4. Start Timer - Identify same element on 2nd page - Stop Timer - Calculate time difference->> C

Page Load time = B - (A + C)
considering A+C is total time taken in identification of elements.

This approach doesn’t give true results and sometimes lead to negative numbers. I believe because appium doesn’t always take same time to identify 1 element.

Any suggestions??

Why are you subtracting A? B does not include the identification of the submit button. Seems like you should be doing this:

  1. Enter search Parameter
  2. Identify Submit button
  3. Start timer, click submit button, check for existence of an item on 2nd page, stop timer and calculate B
  4. Start timer, identify same element, stop timer and calculate C
    Page load time = B -C

You might try an eyeball test to see how long it takes after the page is loaded in step 3 before it identifies the object. I can’t speak to the underlying implementation.

@willosser : Thank you for prompt response.

Though I do not see negative numbers now but figures are still incorrect. And I believe this approach is not good to measure app performance.

I’d look into web debugging proxy such as charles or fiddler.You should be able to hook up your device/emulator easily.

Charles gives you the timings,for example:

Timing
Request Start Time 3/19/15 11:59:26 AM
Request End Time -
Response Start Time -
Response End Time 3/19/15 11:59:59 AM
Duration 33.27 sec
DNS 149 ms
Connect 1.15 sec
SSL Handshake -
Request -
Response -
Latency -
Speed 0.13 KB/s
Response Speed -

PS: I might be doing this myself, but it’s not a priority for me right now.

@Simon_K: agree… I’m trying it using jmeter.