#11 楼 @cy_suncheng 现在可以了,不过运行后,为什么不启动模拟器啊,看日志,提示已经执行成功了。
下面为其中的一个方法
@Test
public void testLogin() {
System.out.println("Executing Login Scenario");
methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
try {
impScreen.login(methodName);
} catch (Exception e) {
e.printStackTrace();
}
}
下面为运行日志
[TestRunner] Running the tests in 'iPhoneHybEshopTest' with parallel mode:tests
[RunInfo] Adding method selector: org.testng.internal.XmlMethodSelector@1c53fd30 priority: 10
[TestClass] Creating TestClass for [ClassImpl class=com.photon.phresco.testcases.iPhoneEshopTest]
[TestNG] Running:
/Users/yunfeiyang/快盘/Example/JavaCode/functional/src/test/resources/testsuite/testsuite.xml
[SuiteRunner] Created 1 TestRunners
[ThreadUtil] Starting executor timeOut:2147483647ms workers:1 threadPoolSize:5
[TestRunner] Running test iPhoneHybEshopTest on 1 classes, included groups:[] excluded groups:[]
===== Test class
com.photon.phresco.testcases.iPhoneEshopTest
@BeforeClass iPhoneEshopTest.setup(java.lang.String, java.lang.String, java.lang.String)[pri:0, instance:com.photon.phresco.testcases.iPhoneEshopTest@7dc36524]
@Test iPhoneEshopTest.testuserRegister()[pri:0, instance:com.photon.phresco.testcases.iPhoneEshopTest@7dc36524]
@Test iPhoneEshopTest.testAddToCartForMobilePhone()[pri:0, instance:com.photon.phresco.testcases.iPhoneEshopTest@7dc36524]
@Test iPhoneEshopTest.testAddToCartForCameras()[pri:0, instance:com.photon.phresco.testcases.iPhoneEshopTest@7dc36524]
@Test iPhoneEshopTest.testAddToCartForAudioDevice()[pri:0, instance:com.photon.phresco.testcases.iPhoneEshopTest@7dc36524]
@Test iPhoneEshopTest.testcheckOutScenario()[pri:0, instance:com.photon.phresco.testcases.iPhoneEshopTest@7dc36524]
@Test iPhoneEshopTest.testAddToCartForComputer()[pri:0, instance:com.photon.phresco.testcases.iPhoneEshopTest@7dc36524]
@Test iPhoneEshopTest.testAddToCartForMP3Players()[pri:0, instance:com.photon.phresco.testcases.iPhoneEshopTest@7dc36524]
@Test iPhoneEshopTest.testLogin()[pri:0, instance:com.photon.phresco.testcases.iPhoneEshopTest@7dc36524]
@Test iPhoneEshopTest.testAddToCartForMovieAndMusic()[pri:0, instance:com.photon.phresco.testcases.iPhoneEshopTest@7dc36524]
@Test iPhoneEshopTest.testAddToCartForTablets()[pri:0, instance:com.photon.phresco.testcases.iPhoneEshopTest@7dc36524]
@Test iPhoneEshopTest.testspecialOffers()[pri:0, instance:com.photon.phresco.testcases.iPhoneEshopTest@7dc36524]
@Test iPhoneEshopTest.testAddToCartForVideoGames()[pri:0, instance:com.photon.phresco.testcases.iPhoneEshopTest@7dc36524]
@Test iPhoneEshopTest.testAddToCartForTV()[pri:0, instance:com.photon.phresco.testcases.iPhoneEshopTest@7dc36524]
@Test iPhoneEshopTest.testAddToCartForAccessories()[pri:0, instance:com.photon.phresco.testcases.iPhoneEshopTest@7dc36524]
@AfterClass iPhoneEshopTest.tearDown()[pri:0, instance:com.photon.phresco.testcases.iPhoneEshopTest@7dc36524]
======
[Invoker 614877437] Invoking @BeforeClass iPhoneEshopTest.setup(java.lang.String, java.lang.String, java.lang.String)[pri:0, instance:com.photon.phresco.testcases.iPhoneEshopTest@7dc36524]
九月 16, 2014 2:44:05 上午 AbstractBaseScreen launchDriver
信息: EXCEPTION IN LAUNCHDRIVER No enum constant com.photon.phresco.enumscreen.LoadXmlParser.IPHONE SIMULATOR
[Invoker 614877437] Invoking com.photon.phresco.testcases.iPhoneEshopTest.testLogin
Executing Login Scenario
九月 16, 2014 2:44:05 上午 AbstractBaseScreen waitForGivenTime
信息: ENTERING WAIT FOR GIVEN TIME
九月 16, 2014 2:44:08 上午 ImplementationScreen login
信息: EXCEPTION IN LOGIN null
[Invoker 614877437] Invoking com.photon.phresco.testcases.iPhoneEshopTest.testAddToCartForTV
九月 16, 2014 2:44:08 上午 AbstractBaseScreen waitForGivenTime
信息: ENTERING WAIT FOR GIVEN TIME
Executing testAddToCartForTV Scenario
九月 16, 2014 2:44:11 上午 ImplementationScreen addToCartForTV
信息: EXCEPTION IN addToCartForTV null
[Invoker 614877437] Invoking com.photon.phresco.testcases.iPhoneEshopTest.testcheckOutScenario
九月 16, 2014 2:44:11 上午 AbstractBaseScreen waitForGivenTime
信息: ENTERING WAIT FOR GIVEN TIME
Executing checkOutScenario Scenario
九月 16, 2014 2:44:14 上午 ImplementationScreen checkOutScenario
信息: EXCEPTION IN checkOutScenario null
[Invoker 614877437] Invoking @AfterClass iPhoneEshopTest.tearDown()[pri:0, instance:com.photon.phresco.testcases.iPhoneEshopTest@7dc36524]
九月 16, 2014 2:44:14 上午 AbstractBaseScreen quitDriver
信息: ENTERING QUITDRIVER OPERATION
===== Invoked methods
iPhoneEshopTest.setup(java.lang.String, java.lang.String, java.lang.String)[pri:0, instance:com.photon.phresco.testcases.iPhoneEshopTest@7dc36524]iPhone simulator iOS 7.1 2109957412
iPhoneEshopTest.testLogin()[pri:0, instance:com.photon.phresco.testcases.iPhoneEshopTest@7dc36524] 2109957412
iPhoneEshopTest.testAddToCartForTV()[pri:0, instance:com.photon.phresco.testcases.iPhoneEshopTest@7dc36524] 2109957412
iPhoneEshopTest.testcheckOutScenario()[pri:0, instance:com.photon.phresco.testcases.iPhoneEshopTest@7dc36524] 2109957412
iPhoneEshopTest.tearDown()[pri:0, instance:com.photon.phresco.testcases.iPhoneEshopTest@7dc36524] 2109957412
=====
Creating /Users/yunfeiyang/快盘/Example/JavaCode/functional/test-output/Mydevice/iPhoneHybEshopTest.html
Creating /Users/yunfeiyang/快盘/Example/JavaCode/functional/test-output/Mydevice/iPhoneHybEshopTest.xml
PASSED: testLogin
PASSED: testAddToCartForTV
PASSED: testcheckOutScenario
===============================================
iPhoneHybEshopTest
Tests run: 3, Failures: 0, Skips: 0
===============================================
===============================================
Mydevice
Total tests run: 3, Failures: 0, Skips: 0
===============================================
[TestNG] Time taken by [FailedReporter passed=0 failed=0 skipped=0]: 0 ms
[TestNG] Time taken by org.testng.reporters.EmailableReporter2@4f47d241: 49 ms
Creating /Users/yunfeiyang/快盘/Example/JavaCode/functional/test-output/old/Mydevice/toc.html
Creating /Users/yunfeiyang/快盘/Example/JavaCode/functional/test-output/old/Mydevice/iPhoneHybEshopTest.properties
Creating /Users/yunfeiyang/快盘/Example/JavaCode/functional/test-output/old/Mydevice/index.html
Creating /Users/yunfeiyang/快盘/Example/JavaCode/functional/test-output/old/Mydevice/main.html
Creating /Users/yunfeiyang/快盘/Example/JavaCode/functional/test-output/old/Mydevice/groups.html
Creating /Users/yunfeiyang/快盘/Example/JavaCode/functional/test-output/old/Mydevice/methods.html
Creating /Users/yunfeiyang/快盘/Example/JavaCode/functional/test-output/old/Mydevice/methods.html
Creating /Users/yunfeiyang/快盘/Example/JavaCode/functional/test-output/old/Mydevice/methods.html
Creating /Users/yunfeiyang/快盘/Example/JavaCode/functional/test-output/old/Mydevice/methods.html
Creating /Users/yunfeiyang/快盘/Example/JavaCode/functional/test-output/old/Mydevice/methods.html
Creating /Users/yunfeiyang/快盘/Example/JavaCode/functional/test-output/old/Mydevice/methods.html
Creating /Users/yunfeiyang/快盘/Example/JavaCode/functional/test-output/old/Mydevice/methods.html
Creating /Users/yunfeiyang/快盘/Example/JavaCode/functional/test-output/old/Mydevice/methods-alphabetical.html
Creating /Users/yunfeiyang/快盘/Example/JavaCode/functional/test-output/old/Mydevice/methods-alphabetical.html
Creating /Users/yunfeiyang/快盘/Example/JavaCode/functional/test-output/old/Mydevice/methods-alphabetical.html
Creating /Users/yunfeiyang/快盘/Example/JavaCode/functional/test-output/old/Mydevice/methods-alphabetical.html
Creating /Users/yunfeiyang/快盘/Example/JavaCode/functional/test-output/old/Mydevice/methods-alphabetical.html
Creating /Users/yunfeiyang/快盘/Example/JavaCode/functional/test-output/old/Mydevice/methods-alphabetical.html
Creating /Users/yunfeiyang/快盘/Example/JavaCode/functional/test-output/old/Mydevice/methods-alphabetical.html
Creating /Users/yunfeiyang/快盘/Example/JavaCode/functional/test-output/old/Mydevice/classes.html
Creating /Users/yunfeiyang/快盘/Example/JavaCode/functional/test-output/old/Mydevice/reporter-output.html
Creating /Users/yunfeiyang/快盘/Example/JavaCode/functional/test-output/old/Mydevice/methods-not-run.html
Creating /Users/yunfeiyang/快盘/Example/JavaCode/functional/test-output/old/Mydevice/testng.xml.html
Creating /Users/yunfeiyang/快盘/Example/JavaCode/functional/test-output/old/index.html
[TestNG] Time taken by org.testng.reporters.SuiteHTMLReporter@e6ea0c6: 80 ms
[TestNG] Time taken by org.testng.reporters.jq.Main@67f89fa3: 51 ms
[TestNG] Time taken by org.testng.reporters.XMLReporter@532760d8: 15 ms
Creating /Users/yunfeiyang/快盘/Example/JavaCode/functional/test-output/junitreports/TEST-com.photon.phresco.testcases.iPhoneEshopTest.xml
[TestNG] Time taken by org.testng.reporters.JUnitReportReporter@27ddd392: 7 ms