Printing to console not working in Karate
Asked Answered
D

2

6

I have scenario which tests an Micro service. Scenario Outline: Run Object Queries

Scenario Outline: Run Object Queries
    Given url homeLinks.queryUrl
    And header Content-Type =  'application/x-www-form-urlencoded'
    When method post
    Then status 200
    Then print response

Print statement is not logging anything to console in InteliJ editor. I tried to run in debug mode as well.

I referred KARATE : can not see print statements on console in karate which didn't help.

Any config changes required to print the logs?

Dennie answered 14/6, 2019 at 9:54 Comment(0)
B
5

Normally people don't run into issues. Refer the docs here: https://github.com/intuit/karate#logging

If you have mixed Karate into a project with a lot of other dependencies this may happen. I suggest you try the Maven quickstart and that will work correctly out of the box: https://github.com/intuit/karate#quickstart

Then it is a matter of comparing the setup with your project. If you still get stuck, follow this process: https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue

Breccia answered 14/6, 2019 at 13:13 Comment(1)
Issue was in logback-test.xml. After comparing with quickstart project it worked. Thank you!!!Dennie
G
4

In logback-test.xml under test/resources, When I change the Console level from WARN to INFO, I can see the logs. My application is spring boot application

<root level="INFO" additivity="false">
		<appender-ref ref="Console" />
	</root>
Gendron answered 26/2, 2020 at 7:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.