Update:
With more test, I noticed that if I execute more navigation sequentially,
without close the driver,
only the firsts ones suffer a considerable slowdown...
Here's some code:
var drivers = new List<IWebDriver>();
for (int i = 0; i < 3; i++)
{
var phantomService = new PhantomJSDriverService.CreateDefaultService();
phantomService.Port = 9190 + i;
drivers.Add(new PhantomJSDriver(phantomService));
}
Parallel.Invoke(
() =>
{
Navigation01(drivers[0]); //<-- slow
Navigation01(drivers[0]);
},
() =>
{
Navigation02(drivers[1]); //<-- slow
Navigation02(drivers[1]);
},
() =>
{
Navigation03(drivers[2]); //<-- slow
Navigation03(drivers[2]);
});
Basically I don't like the idea to manage a pool of PhantomJs instances, I'd like to open/close the driver for each navigation I made.