我无法通过与Sauce Labs集成的终端中的Maven执行 testng.xml 文件,但是我的解决方案通过 testng套件运行在Eclipse控制台中。
我在终端上得到以下输出:
-------------------------------------------------------
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
-----------------------------------------------------------------------------------
我该怎么做?
答案 0 :(得分:0)
如果从终端运行,则必须执行
mvn clean install -DA=A1
A= string defined in your pom
A1 is value to it.
以上默认情况下,将运行pom中给定的默认xml。如果您要运行太多的testng.xml并且需要一些参数,请尝试以下
FROM debian:stretch
RUN apt-get update && \
apt-get install --no-install-recommends --no-install-suggests -y \
gcc libssl-dev python3 python3-dev python3-pip python3-setuptools
RUN pip3 install wheel
RUN CFLAGS="-I/usr/local/opt/openssl/include" LDFLAGS="-L/usr/local/opt/openssl/lib" \
UWSGI_PROFILE_OVERRIDE=ssl=true pip3 install uwsgi -Iv
答案 1 :(得分:0)
此问题已解决,现在我们需要在POM文件中配置Xml文件:
<configuration>
<suiteXmlFiles>
<suitXmlFile>src/main/resources/FileName.xml</suitXmlFile>
</suiteXmlFiles>
</configuration>