void exit()
Note: This command can only be added in the code environment
|
|
|
|
|
The command will close Silk Mobile during runtime.
This is the only command to use for this purpose.
No parameters.
Scenario: In the following example we will run a small test on the EriBank application and after the report is generated, on the tearDown method we will run the exit() command to close Silk Mobile service.
publicclass Untitled { private String host = "localhost"; private int port = 8889; protected Client client = null; @Before public void setUp(){ client = new Client(host, port, true); client.setReporter("xml", "reports", "Untitled"); } @Test public void test01(){ client.setDevice("adb:GT-I9300"); for (int i=0; i<5; i++){ client.openDevice(); client.launch("com.experitest.ExperiBank/.LoginActivity", true, true); client.elementSendText("default", "Username", 0, "company"); client.elementSendText("default", "Password", 0, "company"); client.click("default", "Login", 0, 1); client.click("default", "Logout", 0, 1); client.closeDevice(); } } @After public void tearDown(){ client.generateReport(true); client.exit(); }}