I use Selenium + Idea + Maven. as a command mvn clean test to display the Russian text, which is contained in

driver.getTitle() 
  • Can there a string be contained in a different encoding and obviously need to be converted? - Artem Konovalov

1 answer 1

Try adding to pom.xml:

  <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> </properties> 

Well, in general, look towards the utf-8 encoding. Also check in the settings of the idea File> settings> Editor> File encodings, see what encoding in the run-console.

  • UTF-8 is everywhere, adding to pom did not help. If System.out.print ("some text") is displayed in the console, then everything is successful. If driver.getTitle (), where Title is Russian, then cracks are mariatest
  • ru.stackoverflow.com/questions/571691/… here my question was closed, although none of the answers helped. I lowered my hands - user214105
  • I tried any encodings - none helped - user214105
  • Tried a new String (driver.getTitle (). GetBytes ("UTF-8"), "UTF-8")? As for the console in Windows, I also added some kind of font, I don’t remember exactly - Yura_dan