Issue with repeat view (Remember me checked in)

I am using a logon script to login to site, and then measure performance on submit form.

I want to do the same for repeat view, but in that case, I want to be logged in by just navigating to the site… For that reason, my logon script contains click RememberMe.
However, when I do this, I see that start render is 0, and WPT seems to be showing pretty long time for repeat view. I see some error below

Source Level Message URL Line
console-api log
InPageCommandRunner got a command:
console-api log
Command generated error: Command submitForm failed: Could not find DOM element matching target id=login-form

The issue here is that in repeat view it is trying to execute script, however, user has already logged in (due to Remember Me), so execution is failing.

If there is way to specifiy that repeat view, we don’t execute script but navigate to url – i.e., a different flow in repeat view - that could help address the issue. But I want repeat view, as I want to open a new browser window. Please let me know if there is a way to achieve this.

You can use the if/esle support to block off the chunk of code you only want to run on first view: