web自动化测试框架PatatiumWebUii(5)
发表于:2016-10-14来源:webdriver作者:webdriver点击数:
标签:
,dataProvider = longinData ) public void loginFail (String userName,String password,String message) throws IOException, DocumentException { //代替testng参数化的方法 String BaseUrl= XmlReadUtil
,dataProvider =
"longinData")
public void loginFail (String userName,String password,String message)
throws IOException, DocumentException {
String BaseUrl= XmlReadUtil.getTestngParametersValue(
"testng.xml",
"BaseUrl");
LoginAction loginAction=
new LoginAction(BaseUrl+
"/new/login.aspx",userName,password);
action.sleep(
1);
Assertion.VerityTextPresent(message,
"验证是否出现预期的错误提示信息:"+message);
Assertion.VerityError();
}
测试用例代码放在src/test/java 包下
5、testng.xml配置
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Suite" >
<parameter name="driver" value="FirefoxDriver" />
<parameter name="nodeURL" value="" />
<parameter name="BaseUrl" value="https://passport.jd.com" />