Hello! I have Linux. In Monodevelop, I made a project using Selenium (C # / chromedriver). Everything works for me, I decided to check this program on Windows. I assembled the package, launched it on Windows - the program crashed. The error was this: enter image description here

I have two questions:

1) How to fix it?

2) And how to make a build for Windows?

Here is a sample code:

IWebDriver driver = null; var chromeOptions = new ChromeOptions (); if (proxyEnable) { var proxy = new Proxy (); proxy.HttpProxy = proxyList [random.Next (0, numOfProxies)]; chromeOptions.Proxy = proxy; } if (numOfUserAgents > 0) chromeOptions.AddArgument ("--user-agent=" + userAgentList [random.Next (0, numOfUserAgents)]); driver = new ChromeDriver (path, chromeOptions); 
  • "The error was something like this: OpenQA.Selenium.Chrome ... there are no necessary elements." - well, the answer to the question "how can I fix this?" then it will be obvious to add the necessary elements ... Please kindly describe the error more accurately. - BlackWitcher
  • @BlackWitcher thanks for the criticism, added a screenshot. - Reaget
  • Now I can assume that you simply have the wrong version of WebDriver.dll on your Windows. For example, in it 'MainClass' somehow implements the Surf() and Main() methods. - BlackWitcher
  • @BlackWitcher "Surf ()" is a method I created myself. What do I need to do? Download another WebDriver.dll? - Reaget
  • Perhaps yes, but I cannot say for sure which one, for it OpenQA.Selenium.Chrome.ChromeOptions it initially swears at the OpenQA.Selenium.Chrome.ChromeOptions type, probably it is in it, and the Surf() and Main() methods are methods where this type is somehow involved. Maybe there is somewhere in Selenium itself an indication of the correct version of WebDriver? - BlackWitcher

0