ClickAndWait not waiting long enough

I am trying to measure the performance of a dashboard page. In order to do so, I need to login, get to an intermediate page, and upon button click be redirected to the dashboard page. I am using the below script.

logData 0
navigate [Login url]
setValue name=UserName [Username]
setValue name=Password [Password]
submitForm id=form
logData 1
clickAndWait id=button

The issue I am seeing is the target dashboard page is not fully loading and being captured in WebpageTest. It has a few AJAX calls/spinners on it that could take some time to finish. I don’t see those calls being logged which it would do when the page normally finishes loading. What is happening on ClickAndWait is the page is doing a postback to itself then on server side redirects to the final page. I cannot refactor this now or find a way to set the login via cookies or injection. I am trying to get some performance data to build up a case to work on this page.

This script has finished beautifully before late at night when traffic was low for the site so I’m not sure why it doesn’t work during normal business hours.

Check out this post I submitted to the perf calendar last month:

Try setting the authentication cookie and navigating to the dashboard page directly in the script. It’s two lines and you don’t need to worry about WPT waiting for the page to load.

Thanks. This would be my preferred route to go. But this is legacy code and so much backend processing and setting of session occurs on that click. I would like to see if it is possible for me to get measurements without refactoring the code.

I saw there was numerous end conditions. Anyone know if they would be accurate in my case?