App does not launch

i am using appium studio 10.8. I copied the code to eclipse , and also chnaged the annotations in my script to testng annotations from junit. It was working all the while. All of a sudden my app does not launch at all. It just gives me a time out wait for device error.

How do i solve this issue :frowning:

com.experitest.client.InternalException: Timeout wait for device
at com.experitest.client.JavaClientInternals.waitForDevice(JavaClientInternals.java:395)
at com.experitest.client.Client.waitForDevice(Client.java:234)
at com.experitest.appium.STClientFacade.(STClientFacade.java:185)
at com.experitest.appium.STIOSClientFacade.(STIOSClientFacade.java:15)
at com.experitest.appium.SeeTestIOSDriver.(SeeTestIOSDriver.java:82)
at testpack1.appiumstudio1.setUp(appiumstudio1.java:46)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:108)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:523)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:224)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:146)
at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:166)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:105)
at org.testng.TestRunner.privateRun(TestRunner.java:744)
at org.testng.TestRunner.run(TestRunner.java:602)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:380)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:375)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340)
at org.testng.SuiteRunner.run(SuiteRunner.java:289)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1301)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1226)
at org.testng.TestNG.runSuites(TestNG.java:1144)
at org.testng.TestNG.run(TestNG.java:1115)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:132)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:230)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:76)

your device needs to be on Status “Ready” in the Appium Studio UI before you start the test execution

The device is in Ready state in Appium studio. It just stops working… It was working all these while… I faced this issue atleast twice until now… I have no idea, when it will start working again…

Hi @nisha

Please try the following:

  1. Disconnect the device from your machine.
  2. Locate the app PaltielX in your device and delete it.
  3. Reconnect the device to your machine.
  4. Wait for PaltielX to be reinstalled
  5. Try to run your test from Eclipse

I tried the solution provided above, still does not seem to work.

I am using mac os x 10.12.4. And ios version 10.3.2. I recently updated my appium studio to 10.9.

code still does not run in eclipse… Somebosy help me out!!! How can i solve this?

Its very inconsistent…

could it be that you are not releasing the driver after ends?

can you make sure that you follow the convention of :

import io.appium.java_client.AppiumDriver;
import io.appium.java_client.android.AndroidDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

import java.net.URL;

/**
 * grid-tests
 * Created by tom.ben-simhon on 7/26/2017.
 */
public class TestNGClass {
    AppiumDriver driver;
    @BeforeMethod
    public void setUp() throws Exception {
        DesiredCapabilities dc = new DesiredCapabilities();
        driver = new AndroidDriver(new URL("http://localhost:4723/wd/hub"), dc);

    }

    @Test
    public void testName() throws Exception {
        //some methods
    }

    @AfterMethod
    public void tearDown() throws Exception {
        driver.quit();
    }
}

package testpack1;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.concurrent.TimeUnit;

import org.openqa.selenium.By;
import org.openqa.selenium.remote.DesiredCapabilities;

import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import com.experitest.appium.SeeTestCapabilityType;
import com.experitest.appium.SeeTestIOSDriver;
import com.experitest.appium.SeeTestIOSElement;
import io.appium.java_client.remote.IOSMobileCapabilityType;
import io.appium.java_client.remote.MobileCapabilityType;

public class appiumstudio1 {
private String host = “localhost”;
private int port = 4723;
private String reportDirectory = “reports”;
private String reportFormat = “xml”;
private String testName = “xxx-ios tests";
protected SeeTestIOSDriver driver = null;

@BeforeClass
public void setUp() throws MalformedURLException {
	DesiredCapabilities dc = new DesiredCapabilities();
	dc.setCapability(SeeTestCapabilityType.REPORT_DIRECTORY, reportDirectory);
	dc.setCapability(SeeTestCapabilityType.REPORT_FORMAT, reportFormat);
	dc.setCapability(SeeTestCapabilityType.TEST_NAME, testName);
	dc.setCapability(SeeTestCapabilityType.PROJECT_NAME, “xxxxxx”);
           dc.setCapability(MobileCapabilityType.UDID, “xxxxxxxxxxxxxx”);
       dc.setCapability(IOSMobileCapabilityType.BUNDLE_ID, “xxxxxxxx”);	
           driver = new SeeTestIOSDriver<>(new URL("http://127.0.0.1:4723"), dc);
}

@Test
public void testLogin() {
	driver.deviceAction("Home");
	 driver.findElement(By.xpath("//*[@text='Settings']")).click();
	 driver.swipe(381, 284, 329, 719, 369);
	 Thread.sleep(10000);
                   —— My first test code is here——

}

@Test
public void viewDashboard() 	{
	//Test Case2: 	

}

@AfterClass
public void tearDown() {
	driver.quit();
}

}

I follow this structure. Is something wrong with it?

BeforeClass and AfterClass runs only once per class initialization

change it to BeforeMethod and AfterMethod so it will run after each @Test instance

http://testng.org/doc/documentation-main.html

Strangely i am working on another iphone today, and it works…

Again i am facing the same issue. The app does not launch at all , gives time out… Why does this issue come so randomly and very inconsistent… Please solve this issue … What can be done to avoid the issue?

can you share your most recent code?

when you are able to reproduce the error, could you collect the logs and share them with us?

thanks

Tom

I think this article will solve your problem. - Data Provider in TestNG