1

I am trying to use Selenium's WebDriverWait together with Selenium PhantomJSDriver in my test . At the addition of the Selenium.WebDriver package, the class is usable ( under OpenQA.Selenium.Support.UI) When I add the Selenium.WebDriver.PhantomJS.Xplatform package, that becomes unusable.

If I switch the order of adding the above mentioned packages( managed both time via Nuget, using Rider), the Selenium.WebDriver will make the OpenQA.Selenium.PhantomJS unreachable . I have also added Selenium.Support as seen here : Cannot find WebDriverWait class in OpenQA.Selenium (C#), but that did not help.

Any suggestions on how could I use the WebDriverWait together with PhantomJS?

Daniel
  • 335
  • 1
  • 5
  • 13

1 Answers1

1

PhantomJS is deprecated for several years. Use headless chrome instead

ChromeOptions options = .ChromeOptions()
options.AddArguments("headless");

IWebDriver driver = new ChromeDriver(options));
Guy
  • 46,488
  • 10
  • 44
  • 88
  • I was interested in PhantomJS because it did not imply having a browser installed. As far as I know, using ChromeDriver does require having Chrome browser installed, which is kind of a deal-breaker because I would want to run it on a machine which won't have it. Does it happen to know an alternative for that in Selenium? – Daniel Sep 23 '19 at 10:37
  • 1
    @Daniel Have a look at [HtmlUnitDriver](https://stackoverflow.com/questions/5094605/is-there-an-htmlunitdriver-for-net) – Guy Sep 23 '19 at 10:43
  • 1
    Thank you, I will check out that first ( also maybe selenium xvfb) . I will accept this as answer as it puts me on the right track. – Daniel Sep 23 '19 at 10:52