0

I am facing a problem during assertion of chinese text trying to Change language on the application from English to chinese and assert the text displayed

I am using Cucumber + Testng +Selenium + java+ Intellij

But the asserting is failing.. Added the screenshot below enter image description here

 @Then("Verify all the content is working as expected {string}")
public void verifyAllTheContentIsWorkingAsExpected(String language) {
    Assert.assertEquals(new Login().getTextLoginType("Email"),"电子邮件");

I have already checked UFT-8 and tried other solutions found in here.. it is giving the same error.. Please help on how to fix this

3
  • What happens in getTextLoginType("Email")? That's where the wrongly encoded text comes from so you should check that code. Also please read stackoverflow.com/help/how-to-ask right now none can help you because your question is missing the info needed for a good answer. Commented Jul 29, 2024 at 11:13
  • 1
    Thanks for checking.. it worked after adding -Dconsole.encoding=UTF-8 -Dfile.encoding=UTF-8 under .vmoptions Commented Jul 31, 2024 at 16:59
  • Well done! You should consider writing that as an answer. It might help other people! Commented Jul 31, 2024 at 22:38

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.