Character encoding in IDEA output of AssertionError -
i using intellij idea 12.0.4. have tests. when i'm running 1 using junit4 framework assertion error looks like:
java.lang.assertionerror: status should be: Черновик expected [true] found [false]
if using testng this:
java.lang.assertionerror: status should be: Черновик expected [true] found [false]
all other cyrillic outputs work fine on both framework, assertion text won't.
project files encoding set utf-8.
update: example simple webdriver test. use testng , ie.
import org.testng.assert; import org.testng.annotations.aftersuite; import org.testng.annotations.beforesuite; import org.testng.annotations.dataprovider; import org.testng.annotations.test; import org.openqa.selenium.webdriver; import org.openqa.selenium.ie.internetexplorerdriver; import java.util.concurrent.timeunit; public class seleniumexample { protected webdriver driver; protected string baseurl; @beforesuite public void setup() throws exception { /* local driver */ driver = new internetexplorerdriver(); baseurl = "http://www.google.com"; driver.manage().timeouts().implicitlywait(30, timeunit.seconds); } @dataprovider public object[][] testdata() { return new object[][]{ {"Гугл"}, }; } @test(description = "create_investprojectrequest", dataprovider = "testdata") public void test(string s) { driver.get(baseurl); assert.asserttrue(driver.gettitle().contains(s), "Ошибка"); } @aftersuite public void teardown() throws exception { driver.quit(); } }
in test result output see:
java.lang.assertionerror: Ошибка expected :true actual :false
and problem if use cyrillic in dataprovider, in test tree see test("РћС€Р") instead of test("Гугл")
it's known bug fixed in next update, project helped trace it.
current workaround edit .vmoptions file , add -dfile.encoding=utf-8
option.
Comments
Post a Comment