0

This is my Code

 static void Main(string[] args)
        {
    string _expectedPageTitle = "Google";
                string _firefoxBinaryPath = "Path to firefox";
                FirefoxBinary _binary = new FirefoxBinary(_firefoxBinaryPath);
                FirefoxDriver _driver = new FirefoxDriver(_binary, new FirefoxProfile());
                _driver.Navigate().GoToUrl("http://www.google.com");
                string _currentPageTitle = _driver.Title;
                if (_currentPageTitle.Equals(_expectedPageTitle))
                   Console.WriteLine("Test Passed");
                   //Debug.WriteLine("Test Passed");
                   //Trace.WriteLine("Test Passed");
                else
                    Console.Write("Test Failed");

                //_driver.Close();
}

I tried to get the output in

Console.WriteLine("Test Passed");
Debug.WriteLine("Test Passed");
Trace.WriteLine("Test Passed");

I debugged my code as well, it is navigating to each line.But I can't be able to see the output in the console window.

Could anyone advise.

Aishu
  • 1,310
  • 6
  • 28
  • 52
  • If you found the answer to your question, please accept one of the answers. – JeffC Oct 16 '15 at 15:40
  • Possible duplicate of [What's the difference between Console.WriteLine() vs Debug.WriteLine()?](http://stackoverflow.com/questions/3012822/whats-the-difference-between-console-writeline-vs-debug-writeline) – JeffC Oct 16 '15 at 15:41

2 Answers2

3

Console.WriteLine method writes your output to the console window opened by your application (for terminal applications and windows apps)

Debug.WriteLine writes to the debug output window. You can open the Output window (Debug => Windows => Output)

debugger89
  • 2,108
  • 2
  • 14
  • 16
1

Have you tried?

System.Diagnostics.Debug.WriteLine

Spirit
  • 150
  • 1
  • 10