Java 在IntelliJ IDEA中执行的Maven Selenium WebDriver项目中编码警告
我在IntelliJ IDEA 14.0.2中有一个Maven Selenium WebDriver项目。我的pom.xml文件如下:Java 在IntelliJ IDEA中执行的Maven Selenium WebDriver项目中编码警告,java,maven,encoding,selenium-webdriver,Java,Maven,Encoding,Selenium Webdriver,我在IntelliJ IDEA 14.0.2中有一个Maven Selenium WebDriver项目。我的pom.xml文件如下: <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaL
<?xml version="1.0" encoding="UTF-8"?>
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>MasteringSeleniumTestingTools</groupId>
<artifactId>Chapter3</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.45.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!<br>
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
4.0.0
掌握Selenium测试工具
第三章
1.0-快照
org.seleniumhq.selenium
硒爪哇
2.45.0
朱尼特
朱尼特
4.12
测试
当我以测试命令的形式运行项目时,一些警告如下所示:
<?xml version="1.0" encoding="UTF-8"?>
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>MasteringSeleniumTestingTools</groupId>
<artifactId>Chapter3</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.45.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!<br>
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[警告]使用平台编码(实际上是UTF-8)复制过滤后的资源,即构建依赖于平台
[警告]未使用平台编码UTF-8设置文件编码,即生成依赖于平台!
...
UTF8
。。。
UTF-8
也有效 由于编码问题,我的断言在assertEquals行(“SeleniumWebDriver-SeleniumDocumentation”,driver.getTitle())失败;因为实际标题打印为“Selenium WebDriver”� “Selenium Documentation”而不是“Selenium WebDriver-Selenium Documentation”是的,这在添加属性后起作用-谢谢UTF-8和UTF8之间的区别是什么?可能什么都没有,但我不知道。UTF-8和UTF8都在为我工作。以下是一些详细说明: