Test running in browserstack, the test initialized all beans with the newly generated driver session as soon as it started. In the event that the session expires, a new driver instance will be generated. However, despite the fact that a new session is available, the test failed because the bean was initialized with the prior value of the session. Is there any way to resolve the issue in the spring context?
I tried using a spring annotation @Refreshscope so that it will re initialize the bean but it didn't work.