Run entire test suite from testng

4 replies [Last post]
udaya.anem
Offline
Joined: 04/02/2017

I have my individual tests working without any issues.

But when i execute these tests from testng.xml only the first test is executing and aborting execution.

Can someone let me know what i am missing in below?

Following is my testng.xml:

Though i set my device everything in my actual test, and i am closing client in tearDown as
client.generateReport(true);

Following is my console output:
Sun Apr 02 13:04:59 IST 2017 [main] Agent drop all zones
Sun Apr 02 13:04:59 IST 2017 [main] Start test EriBank
Sun Apr 02 13:04:59 IST 2017 [main] C:\Users\E002841\seetest-reports\reports\test27
Sun Apr 02 13:04:59 IST 2017 [main] Agent drop all zones
Sun Apr 02 13:04:59 IST 2017 [main] Start test VerifyInvalidLogin
Sun Apr 02 13:04:59 IST 2017 [main] C:\Users\E002841\seetest-reports\reports\test28
Sun Apr 02 13:04:59 IST 2017 [main] Set device to: adb:09478d300f4133f6
Sun Apr 02 13:04:59 IST 2017 [main] Device Information
Name: Nexus 5
S/N: 09478d300f4133f6
OS: Android
Manufacture: LGE
Model: Nexus 5
Version: 6.0.1
Screen size: 1080x1920
Connected to: 127.0.0.1

Sun Apr 02 13:05:04 IST 2017 [main] Launch native activity / URL com.experitest.ExperiBank/.LoginActivity
Sun Apr 02 13:05:04 IST 2017 [main] Wait for 'id=usernameTextField' in zone NATIVE, timeout: 20000
Sun Apr 02 13:05:04 IST 2017 [main] Found: true
Sun Apr 02 13:05:05 IST 2017 [main] Send text company to element NATIVE:id=usernameTextField[0]
Sun Apr 02 13:05:06 IST 2017 [main] Wait for 'id=passwordTextField' in zone NATIVE, timeout: 20000
Sun Apr 02 13:05:06 IST 2017 [main] Found: true
Sun Apr 02 13:05:07 IST 2017 [main] Send text password to element NATIVE:id=passwordTextField[0]
Sun Apr 02 13:05:08 IST 2017 [main] Click 'text=Login' in zone NATIVE, index: 0, click count: 1
Sun Apr 02 13:05:09 IST 2017 [main] Wait for 'text=Invalid username or password!' in zone NATIVE, timeout: 20000
Sun Apr 02 13:05:09 IST 2017 [main] Found: true
Sun Apr 02 13:05:10 IST 2017 [main] Check if 'text=Invalid username or password!' is found in zone 'NATIVE' index 0
Sun Apr 02 13:05:10 IST 2017 [main] Found: true
Sun Apr 02 13:05:11 IST 2017 [main] Error message 'Invalid username or password' is displayed
Sun Apr 02 13:05:11 IST 2017 [main] Click 'text=Close' in zone NATIVE, index: 0, click count: 1
Sun Apr 02 13:05:13 IST 2017 [main] Send text to element NATIVE:id=usernameTextField[0]
Sun Apr 02 13:05:14 IST 2017 [main] Send text to element NATIVE:id=passwordTextField[0]
Sun Apr 02 13:05:14 IST 2017 [main] Set application title to: adb:09478d300f4133f6
Sun Apr 02 13:05:14 IST 2017 [main] Status: false
Sun Apr 02 13:05:19 IST 2017 [main] C:\Users\E002841\seetest-reports\reports\test28

===============================================
Seetest
Total tests run: 2, Failures: 1, Skips: 0
===============================================

udaya.anem
Offline
Joined: 04/02/2017

The testng.xml content was not displayed in above post, so removing "<" and ">" tags including here again:

suite name="Seetest"
test name="NativeAppExample"
classes
class name="VerifyInvalidLogin" /
class name="EriBank" /
/classes
/test
/suite

arundoss
Offline
Joined: 02/04/2015

Hi,

It seems like you are trying to use setDevice command to set the device before the device is released from the existing client. Make sure you have two devices connected if you are expecting to run tests in parallel or use releaseClient command to release the client before you use setDevice again.

If you have any specific queries on the same regard, please send an email to support@experitest.com

udaya.anem
Offline
Joined: 04/02/2017

I am running two tests sequentially. Each of these tests have @AfterTest method, where i am using
client.generateReport(true);
client.releaseClient();

I am also keeping wait time(10 Sec.) after releasing the client.

So ideally when the 2nd test started executing, the client should be ready.

And can you please share me any pointers for how run scripts parallel. When surfed over net found that we need separate licence for each device we work on.

arundoss
Offline
Joined: 02/04/2015

You need to have a client created before you run your setDevice command again.
Please send us the script you are executing to support@experitest.com so that we can review the issue.