我正在尝试从包含变音符号的字段中获取文本:ă,ă-Ă-â-â-â-Î-ş-Ş-ţ-Ţ
我获取文本的方法如下所示:
public void invalidEmailValidation(){
String expectedInner = LoginPage.invalidMailMessage(driver).getAttribute("innerText");
String expectedText = LoginPage.invalidMailMessage(driver).getText();
System.out.print("EXPECTED1: " + expectedInner + "\n" +
"EXPECTED2: " + expectedText );
Assert.assertEquals("Expcted Inner: Adresa de email nu este validă",
expectedInner, "Adresa de email nu este validă");
Assert.assertEquals("Expcted text: Adresa de email nu este validă",
expectedText, "Adresa de email nu este validă");
我提到我的项目有UTF-8编码 此外,还在pom.xml中添加了UTF-8编码:
<?xml version="1.0" encoding="UTF-8"?>
http://maven.apache.org/xsd/maven-4.0.0.xsd“&GT; 4.0.0
其他信息: IDE:IntellijIdea 14.1.4(社区版) 操作系统:Windows 7(默认为英语) 我已经从StackOverflow检查了以下问题: Cannot verify text with diacritics Empty string