How to test with a script?

If you want to collect the full sequence then change the logdata 0/1 to be combinesteps. Otherwise WebPagetest will give you quite screwy results if you are trying to measure more than one interaction.

Your last command also needs to be an “andwait” variation, otherwise it’s not going to wait for anything to happen before ending the test.

If you can’t get it to interact with the page in the way you’d like, the easiest fallback is to use the exec command with a chunk of javascript and you can use a local browser console to get the javascript working the way you’d like before submitting it as part of the test.