0

How does one use ThreadLocal Webdriver for parallel browser execution in kotest? Somehow I believe kotlin coroutines messes this up.

Ryan M
  • 18,333
  • 31
  • 67
  • 74
Ankit
  • 169
  • 1
  • 4
  • 16

1 Answers1

0

As you say, ThreadLocal doesn't always play nice with coroutines. A coroutine may resume on any thread that is owned by the CoroutineDispatcher.

I think the proper way about it would be to add your Webdriver as a Coroutine context element. Either create your own context element or you can have a look at this, perhaps you can use that in conjunction with a listener ?

Emil Kantis
  • 1,069
  • 7
  • 17