无法在终端中使用 Testng.xml 文件通过 Maven 测试执行 类,但在 Eclipse 中工作
Not able to execute classes through Maven test with Testng.xml file in terminal, but working in Eclipse
我无法在与 Sauce Labs 集成的终端中通过 Maven 执行 testng.xml 文件,但我得到了我的解决方案 运行 通过 Eclipse 控制台中的 testng suit。
我在终端上得到以下输出:
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running TestSuite
Oct 19, 2018 2:06:31 PM org.openqa.selenium.remote.ProtocolHandshake
createSession
INFO: Detected dialect: OSS
Selected Mattress from header
Oct 19, 2018 2:06:46 PM org.openqa.selenium.remote.ProtocolHandshake c
createSession
INFO: Detected dialect: OSS
Selected Mattress from header
Oct 19, 2018 2:08:18 PM org.openqa.selenium.remote.ProtocolHandshake
createSession
INFO: Detected dialect: OSS
Selected Mattress from header
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed:
125.596 sec - in TestSuite
**Results:**
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:22 min
[INFO] Finished at: 2018-10-19T14:08:28+05:30
[INFO] ------------------------------------------------------------------------
我通过 Eclipse 控制台获得以下输出。我想通过终端获得相同的解决方案:
[RemoteTestNG] detected TestNG version 6.14.2
Oct 19, 2018 2:44:36 PM org.openqa.selenium.remote.ProtocolHandshake
createSession
INFO: Detected dialect: OSS
Selected Mattress from header
Selected Mattress option from menu
ATC button Clicked
Popup closed
Checkout
FirstName entered
LastName entered
Emailid entered
Telephone number entered
AddAddressManualy link clicked
Billing Information completed: achetez le matelas et les produits eve - Panier | eve Matelas
Delivery completed: achetez le matelas et les produits eve - Panier | eve Matelas
-----------------------------------------------------------------------------------
Redirect to paypal Done: achetez le matelas et les produits eve - Panier | eve Matelas
-----------------------------------------------------------------------------------
Payment Completed: PayPal Checkout - Review your payment
-----------------------------------------------------------------------------------
Oct 19, 2018 2:47:02 PM org.openqa.selenium.remote.ProtocolHandshake
createSession
INFO: Detected dialect: OSS
Selected Mattress from header
Selected Mattress option from menu
ATC button Clicked
Popup closed
Checkout
FirstName entered
LastName entered
Emailid entered
Telephone number entered
AddAddressManualy link clicked
Billing Information completed: achetez le matelas et les produits eve - Panier | eve Matelas
Delivery completed: achetez le matelas et les produits eve - Panier | eve Matelas
-----------------------------------------------------------------------------------
Redirect to Card Payment
-----------------------------------------------------------------------------------
Card Payment Completed: bravo ! bienvenue dans la famille eve matelas | eve Matelas
-----------------------------------------------------------------------------------
我怎样才能做到这一点?
如果您从终端机 运行ning,则必须执行
mvn clean install
默认情况下上面将 运行 默认 xml 在你的 pom.xml 中给出。如果你想要 运行 太多 testng.xml 并且它需要一些参数,请尝试下面的
mvn clean install -DA=A1
A= string defined in your pom
A1 is value to it.
这已解决,现在我们需要在 POM 文件中配置 Xml 文件:
<configuration>
<suiteXmlFiles>
<suitXmlFile>src/main/resources/FileName.xml</suitXmlFile>
</suiteXmlFiles>
</configuration>
我无法在与 Sauce Labs 集成的终端中通过 Maven 执行 testng.xml 文件,但我得到了我的解决方案 运行 通过 Eclipse 控制台中的 testng suit。
我在终端上得到以下输出:
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running TestSuite
Oct 19, 2018 2:06:31 PM org.openqa.selenium.remote.ProtocolHandshake
createSession
INFO: Detected dialect: OSS
Selected Mattress from header
Oct 19, 2018 2:06:46 PM org.openqa.selenium.remote.ProtocolHandshake c
createSession
INFO: Detected dialect: OSS
Selected Mattress from header
Oct 19, 2018 2:08:18 PM org.openqa.selenium.remote.ProtocolHandshake
createSession
INFO: Detected dialect: OSS
Selected Mattress from header
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed:
125.596 sec - in TestSuite
**Results:**
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:22 min
[INFO] Finished at: 2018-10-19T14:08:28+05:30
[INFO] ------------------------------------------------------------------------
我通过 Eclipse 控制台获得以下输出。我想通过终端获得相同的解决方案:
[RemoteTestNG] detected TestNG version 6.14.2
Oct 19, 2018 2:44:36 PM org.openqa.selenium.remote.ProtocolHandshake
createSession
INFO: Detected dialect: OSS
Selected Mattress from header
Selected Mattress option from menu
ATC button Clicked
Popup closed
Checkout
FirstName entered
LastName entered
Emailid entered
Telephone number entered
AddAddressManualy link clicked
Billing Information completed: achetez le matelas et les produits eve - Panier | eve Matelas
Delivery completed: achetez le matelas et les produits eve - Panier | eve Matelas
-----------------------------------------------------------------------------------
Redirect to paypal Done: achetez le matelas et les produits eve - Panier | eve Matelas
-----------------------------------------------------------------------------------
Payment Completed: PayPal Checkout - Review your payment
-----------------------------------------------------------------------------------
Oct 19, 2018 2:47:02 PM org.openqa.selenium.remote.ProtocolHandshake
createSession
INFO: Detected dialect: OSS
Selected Mattress from header
Selected Mattress option from menu
ATC button Clicked
Popup closed
Checkout
FirstName entered
LastName entered
Emailid entered
Telephone number entered
AddAddressManualy link clicked
Billing Information completed: achetez le matelas et les produits eve - Panier | eve Matelas
Delivery completed: achetez le matelas et les produits eve - Panier | eve Matelas
-----------------------------------------------------------------------------------
Redirect to Card Payment
-----------------------------------------------------------------------------------
Card Payment Completed: bravo ! bienvenue dans la famille eve matelas | eve Matelas
-----------------------------------------------------------------------------------
我怎样才能做到这一点?
如果您从终端机 运行ning,则必须执行
mvn clean install
默认情况下上面将 运行 默认 xml 在你的 pom.xml 中给出。如果你想要 运行 太多 testng.xml 并且它需要一些参数,请尝试下面的
mvn clean install -DA=A1
A= string defined in your pom
A1 is value to it.
这已解决,现在我们需要在 POM 文件中配置 Xml 文件:
<configuration>
<suiteXmlFiles>
<suitXmlFile>src/main/resources/FileName.xml</suitXmlFile>
</suiteXmlFiles>
</configuration>