0

I am new in mobile automation and first time trying to launch the app in emulator. Just the mobile screen blinks but My app doesn't get launched. Can anyone help me..

import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;

import org.openqa.selenium.remote.DesiredCapabilities;

import io.appium.java_client.AppiumDriver;
import io.appium.java_client.MobileElement;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.remote.MobileCapabilityType;

public class AppTest {
    


    public static AppiumDriver<MobileElement>appium;

    public static void main(String[] args)  {
        // TODO Auto-generated method stub
        File app = new File("C:\\Users\\User\\Desktop\\iTest-20.07(43).apk");
        DesiredCapabilities caps = new DesiredCapabilities();
        caps.setCapability(MobileCapabilityType.APP,app.getAbsolutePath());
        caps.setCapability("deviceName","emulator-5554");
        caps.setCapability("platformName", "Android");
        caps.setCapability("platformVersion", "8.0");
        caps.setCapability("appPackage", "com.google.android.apps.nexuslaunch");
        caps.setCapability("appActivity", "com.google.android.apps.nexuslaunch.NexusLaunchActivity");
        caps.setCapability("noReset", "false");
        caps.setCapability("disableWindowAnimation", false);


        try {
            appium = new AndroidDriver<MobileElement>(new URL("http://0.0.0.0:4723/wd/hub"), caps);
        } catch (MalformedURLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        System.out.println("Application Launched");
    }
}
 

Result:

io.appium.java_client.remote.AppiumCommandExecutor$1 lambda$0
INFO: Detected dialect: W3C
  • 1
    What you show is not an error. Just INFO message. – Alexey R. Jul 31 at 15:11
  • You have Just intialized the AndroidDriver class with appium object. You have to do something with this object based on your test cases. I think there is no error occurred it is the log from the appium executer. – Mohamed Sulaimaan Sheriff Jul 31 at 16:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy