ant 生成html 乱码,Ant执行脚本在控制台输出中文乱码

没整出来原因....改天再试

build.xml: 已经改成UTF-8了,还是不行

testng.xml

src:

package test;

import java.io.UnsupportedEncodingException;

import org.openqa.selenium.By;

import org.openqa.selenium.support.ui.Select;

import org.testng.annotations.Test;

import com.citsamex.axo.domair.CommonFunction;

public class NewTest1 extends CommonFunction

{

@Test

public void f()

{

onlineLogin(companyId,userName,passWord);

driver.findElement(By.cssSelector("a.clsA")).click();//click domair tab

driver.findElement(By.xpath("//input[@name='domesticFlightSearchVO.domAirType']")).click();//one way

waitForTime(1000);

//Departure city

driver.findElement(By.id("oneWayDeparture")).click();

driver.findElement(By.id("oneWayDeparture")).clear();

driver.findElement(By.id("oneWayDeparture")).click();

waitForTime(1000);

driver.findElement(By.id("oneWayDeparture")).sendKeys("天津");

waitForTime(1000);

pressEnterKey();

//Arrive city

driver.findElement(By.id("oneWayArrive")).click();

driver.findElement(By.id("oneWayArrive")).clear();

driver.findElement(By.id("oneWayArrive")).click();

waitForTime(1000);

driver.findElement(By.id("oneWayArrive")).sendKeys("北京");

waitForTime(1000);

pressEnterKey();

//Departure Date

driver.findElement(By.id("oneWayDepartureDate")).click();

driver.findElement(By.id("oneWayDepartureDate")).clear();

driver.findElement(By.id("oneWayDepartureDate")).click();

waitForTime(1000);

if(oneWayDepartureDate!=null)

driver.findElement(By.id("oneWayDepartureDate")).sendKeys(oneWayDepartureDate);

else

driver.findElement(By.id("oneWayDepartureDate")).sendKeys(nextMonthToday());

waitForTime(1000);

pressEnterKey();

//read time

new Select(driver.findElement(By.id("oneWayDepartureTime"))).selectByVisibleText("00:00-24:00");

//select cabin code

new Select(driver.findElement(By.id("cabinCode"))).selectByValue(cabinCodeFCY);

waitForTime(1000);

//click search button

driver.findElement(By.id("searchFlightBtn")).click();

waitForTime(5000);

if(!driver.getCurrentUrl().startsWith(searchDomesticFlightActionUrl))

System.out.println("domestic flight one way search failed, pls check...");

if(driver.findElement(By.cssSelector("div.wrong>div.wrong-x>p.Prompt")).isDisplayed())

{

System.out.println("乱码+luanma+乱码" );

System.out.println("the departure city is: "+driver.findElement(By.id("oneWayDeparture")).getAttribute("value"));

System.out.println("the arrive city is: "+driver.findElement(By.id("oneWayArrive")).getAttribute("value"));

}

}

}

expect result console:

乱码+luanma+乱码

the departure city is: 天津

the arrive city is: 北京

PASSED: f

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值