Fragment Not Associated With A Fragment Manager

I found out that in my case the issue was related to threading. I solved it with:

 lifecycleScope.launchWhenResumed {

Would be good to know if this help you?!

Comment below code of yours

   if (user == null) 
      //navigate to login screen if no user exists 
      //navigate to business list if user already logged in 
}, 2000)

If it works fine then

use Thread.sleep(5000) or IdlingResource to make a delay in your instrumentation test cases.

Root Cause: Actually, during your test case runtime, you are trying to operate upon the fragment which is waiting on Handler for 2000 millies to execute.