In some cases the diagnostics application on a device starts in login screen where the user is queried for username, password, PIN etc. It is not possible to proceed to diagnostics tests from here.
On Android this typically happens if the user starts the diagnostics application from menu although the application is already running. 'Recent apps' functionality should be used to navigate to the diagnostics application if it is already running. On Apple this typically happens due to a faulty cable. It is possible to recover from the situation by disconnecting the device and then connecting it again.