Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

6
  • Why not create a new thread? Simplest and uglies way is to create a new thread and put a while (true) to check if the driver is still null, then continue with myFunctionUsingDriverObject()? Commented Nov 22, 2017 at 16:38
  • @SoroushFalahati I believe OP wants to implement functionality similar to "UI thread" and Dispatcher.Invoke in WPF where some objects must be only accessed on "UI thread". This is quite common requirement as some objects (particularly Windows UI once) may behave incorrectly when used from thread that is different from one that created them. Commented Nov 22, 2017 at 16:40
  • I think you are looking for bing.com/search?q=c%23+schedule+task+particular+thread like stackoverflow.com/questions/30719366/…. (May be even duplicate) Commented Nov 22, 2017 at 16:42
  • @AlexeiLevenkov, I am not sure. He says that he cant create a new ChromeDriver as it blocks the main thread. Then he wants to run myFunctionUsingDriverObject() with the resulting ChromeDriver from the other thread. Commented Nov 22, 2017 at 16:42
  • @SoroushFalahati yes, exactly what I tried to say - replicate "UI thread" + Invoke functionality with custom thread "My Special Thread" + MySpecialThreadInvoke... Commented Nov 22, 2017 at 16:45