Any ideea why output to console is not working?

Ask general questions here.
prepelra
Posts: 11
Joined: Tue Apr 02, 2019 9:33 am

Any ideea why output to console is not working?

Post by prepelra » Tue Jul 09, 2019 9:15 am

I tried different options

System.Console.WriteLine("bla bla bla");
System.Diagnostics.Debug.WriteLine("bla, bla, bla");
Console.WriteLine("bla bla");

what am I missing?

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 6037
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Any ideea why output to console is not working?

Post by odklizec » Tue Jul 09, 2019 9:35 am

Hi,

All lines are correct and works fine for me? The output of second line is just written to debug console...
ConsoleWrite.png
ConsoleWrite.png (16.57 KiB) Viewed 25 times
Are you looking for something else?
Last edited by odklizec on Wed Jul 01, 2020 10:50 am, edited 1 time in total.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

damien
Posts: 6
Joined: Wed Jun 24, 2020 8:17 am

Re: Any ideea why output to console is not working?

Post by damien » Wed Jul 01, 2020 10:29 am

I have the same issue, I don't manage to have the following displayed in the Output/Debug
System.Diagnostics.Debug.WriteLine("bla, bla, bla");

Is there a setting to activate ?

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 6037
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Any ideea why output to console is not working?

Post by odklizec » Wed Jul 01, 2020 10:52 am

Hi,

System.Diagnostics.Debug.WriteLine writes output to app console (black) window. This window is only available during the app run and only if the test is compiled as console app! If you want to write output to output tab, you must use Console.WriteLine or System.Console.WriteLine. I'm not aware of a command for sending output to Ranorex "Console" tab.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

damien
Posts: 6
Joined: Wed Jun 24, 2020 8:17 am

Re: Any ideea why output to console is not working?

Post by damien » Wed Jul 01, 2020 12:45 pm

Hi, thanks for your usual quick feedback.
Unfortunately I still didn't manage to have output, so I'm trying to be more precise and giving you some screenshots and explanations about what I do. So maybe we can find what I do wrong here :D

So in the first file:
@ 1: I have a user code
@2: I would like to have output here but nothing is displayed

In the second file:
you can see the code that I'm using to display in output

A last thing, I'm trying to run that TC only (clicking "RUN RECORDING"), I don't know if this can be a reason why it doesn't work.

Thanks in advance for your answers !
Attachments
ranorex2.png
ranorex2.png (104.06 KiB) Viewed 19 times
ranorex1.png
ranorex1.png (128.48 KiB) Viewed 19 times

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 6037
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Any ideea why output to console is not working?

Post by odklizec » Wed Jul 01, 2020 1:23 pm

Hi,

Well the solution is to enable "debug" mode. From your screenshots I see you have debugging disabled. And "debug" output definitely requires enabled debugging ;)
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

damien
Posts: 6
Joined: Wed Jun 24, 2020 8:17 am

Re: Any ideea why output to console is not working?

Post by damien » Wed Jul 01, 2020 3:21 pm

Thanks, it works much better :D