Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Logging from event handler #4257

Open
BenjaminGrimm opened this issue Nov 23, 2022 · 0 comments
Open

Question: Logging from event handler #4257

BenjaminGrimm opened this issue Nov 23, 2022 · 0 comments

Comments

@BenjaminGrimm
Copy link

Hi,

I got a question regarding logging. We use nunit.framework (3.10.1.0) to run automated Ui tests. In our setup the nunitlite-runner.exe interacts with a running instance of the programm we want to test. This generally works well since we use a single worker.

Testcontext.Process.WriteLine is used to generate logging for the console.

We are currently adding the capability to handle predefined dialogs that might appear sporadically and are not part of the test. We therefor register to Ui events. This approach works as intended, however calling TestContext.Process.WriteLine does not seem to have any effect in the event handler method. Presumably because it does not run in the same thread as the actual test. Passing the TestContext.Process Textwriter into the handler method does not help, however passing in TestContext.Out did work, but this would result in the messages to appear out of order and is therefor not usefull in this scenario.

Is there a way log messages from an event triggered call and have them associated with the current test?

Thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants