I am trying to to use selenium.exe (actual filename) to open FireFox and execute some stuff. Everyting is working fine if i call the method by a button, for example. But i want to user selenium arg in command prompt.
As seen in How I create exe in that I pass parameters in C#.net and How to pass parameters to an exe? and Launch Program with Parameters it would seem that a simple Main(string[] message)
would suffice.
But when i type selenium "test" the application does nothing.
I put the selenium.exe (actual filename) (leave the other files in bin\Release) in C:\ and run it from a prompt.
I found weird that the executable is 10KB, but gecko executable itself is 5,000+KB.
Here is Program.cs, that should call the MyMethod() method:
static void Main(string[] message)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
System.Console.WriteLine("Page title i");
MyMethod(message[0]);
Application.Run(new Form1());
}
And MyMethod() that is never called from command line, but works perfectly if called from a Form button:
static void MyMethod(string message)
{
IWebDriver driver = new FirefoxDriver();
driver.Navigate().GoToUrl("https://never.gets.here/");
//MORE STUFF
}