In order to eliminate unreadable characters from the console output during execution, we set the monochrome option to true inside the @CucucmberOptions annotation. You can set this option to true or false. By default, it is set to False.
Monochrome as False in Cucumber
Monochrome is mentioned in the Runner class.
import io.cucumber.testng.AbstractTestNGCucumberTests;
import io.cucumber.testng.CucumberOptions;
@CucumberOptions(tags = "", features = "src/test/resources/Features", glue = "org.example.stepdefinitions", monochrome=false
,plugin = {"pretty"})
public class CucumberRunnerTests extends AbstractTestNGCucumberTests {
}
The output of the above program is
![](https://qaautomation.expert/wp-content/uploads/2023/10/image-58.png?w=1200)
Monochrome as True in Cucumber
When monochrome value set to true, It will make console output for the Cucumber test much more readable and remove any unreadable character.
package org.example.runner;
import io.cucumber.testng.AbstractTestNGCucumberTests;
import io.cucumber.testng.CucumberOptions;
@CucumberOptions(tags = "", features = "src/test/resources/Features", glue = "org.example.stepdefinitions", monochrome=true
,plugin = {"pretty"})
public class CucumberRunnerTests extends AbstractTestNGCucumberTests {
}
The output of the above program is
![](https://qaautomation.expert/wp-content/uploads/2023/10/image-59.png?w=1200)
Congratulations on making it through this tutorial and hope you found it useful! Happy Learning!! Cheers!!