我正在使用IntelliJ IDEA 12.0.4.做一些测试.当我使用JUnit4框架运行时,我的Assertion Error看起来像:
java.lang.AssertionError: Status should be: ???????? expected [true] but found [false]
Run Code Online (Sandbox Code Playgroud)
如果我使用的是TestNG,它看起来像这样:
java.lang.AssertionError: Status should be: ?§?µ???????????? expected [true] but found [false]
Run Code Online (Sandbox Code Playgroud)
所有其他西里尔语输出在两个框架上都能正常工作,只有断言文本才能正常工作.
项目文件编码设置为UTF-8.
更新: 例如简单的WebDriver测试.我使用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() …Run Code Online (Sandbox Code Playgroud) 我使用 Google Maps Api 制作地图和标记。
我通过设置启用标记的可访问性: mapView.accessibilityElementsHidden = false
现在,我在地图上的所有自定义标记都具有可访问性 ID,例如:myappname.GMSPlaceMarker_somenumbers,例如myappname.GMSPlaceMarker_0x600000170200。
例如,我如何accessibilityIdentifier为所有引脚设置一个Map pin?
我已经尝试过:
marker.accessibilityLabel = "Map pin"但它设定了label价值,而不是idmarker.title = "Map pin" 没有什么改变marker.setValue("Map pin", forKey: "accessibilityIdentifier") 没有什么改变我marker的let marker = GMSPlaceMarker()在哪里class GMSPlaceMarker: GMSMarker
我正在使用Jenkins构建我的Maven项目并使用插件发布testng结果。报告中的西里尔符号有问题。看起来像:????????。但是在Jenkins控制台中的西里尔字母输出是可以的。
我的pom.xml:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<modelVersion>4.0.0</modelVersion>
<groupId>ru.ibs</groupId>
<artifactId>msprjtest</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.8.5</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.32.0</version>
</dependency>
<dependency>
<groupId>com.opera</groupId>
<artifactId>operadriver</artifactId>
<version>1.2</version>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>com.googlecode</groupId>
<artifactId>maven-idea-plugin</artifactId>
<version>1.6.1</version>
<configuration>
<!--vmParameters>-Dfile.encofing=UTF-8</vmParameters-->
<compileInBackground>false</compileInBackground>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.14.1</version>
<configuration>
<reportsDirectory>${basedir}/test-output</reportsDirectory>
<suiteXmlFiles>
<suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
</configuration> …Run Code Online (Sandbox Code Playgroud)