@Test // checking the login functionality
@Parameters({"username" , "password"})
public void TpPortalLogin(String username, String password)
throws InterruptedException, IOException
{
System.out.println("Page title before login: " +driver.getTitle());
System.out.println("username: "+username);
System.out.println( "password"+password);
这是 testng.xml 文件:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Suite" parallel="false">
<test name="TpPortalLogin">
<parameter name="browser" value="chrome"/>
<parameter name="url" value="http://xyz.local/"/>
<parameter name="username" value="somebody"/>
<parameter name="password" value="something"/>
<classes>
<class name="com.parameterization.TestParameters" />
</classes>
</test> <!-- Test -->
</suite> <!-- Suite -->
这是一个例外:
org.testng.TestNGException: org.xml.sax.SAXParseException; lineNumber: 3; columnNumber: 251;
Attribute "parallel" with value "none" must have a value from
the list "false methods tests classes instances ".
at org.testng.TestNG.initializeSuitesAndJarFile(TestNG.java:325)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:103)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:137)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:58)
Caused by: org.xml.sax.SAXParseException; lineNumber: 3; columnNumber: 251;
Attribute "parallel" with value "none" must have a value from
the list "false methods tests classes instances ".
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
任何想法将不胜感激。
在 testng.xml 中,没有参数“parallel”设置为“none”,因此异常会抱怨一个是没有意义的。
谢谢,
病死率。