mardi 13 novembre 2018

What are the best practices for appium framework using page opject model

I am developing an automation framework for a mobile application using Appium (in java). I started with creating a class per view, in each class, I find and initialize elements of that class. Now after a while I understand my configuration for the framework is not correct and I'm not able to expand it. It would be great if anyone can introduce me an implemented framework on Github.

here is my config class, I use setdriver() to set a driver wherever I need.

public class Config {

public AndroidDriver<AndroidElement> driver;

public static AndroidDriver<AndroidElement> SetDriver() throws MalformedURLException {

    File appPath= new File("src");
    File app = new File(appPath,"My-debug.apk");

    DesiredCapabilities cap = new DesiredCapabilities();
    cap.setCapability(MobileCapabilityType.DEVICE_NAME, "myDevice");
    cap.setCapability(MobileCapabilityType.APP,app.getAbsolutePath());
    cap.setCapability("autoGrantPermissions",true);
    cap.setCapability("appWaitActivity","com.xxxx.xxxx.ui.launch.LaunchActivity");
    AndroidDriver<AndroidElement> driver = new AndroidDriver<AndroidElement>(new URL("http://127.0.0.1:4723/wd/hub"),cap);

    return driver;
}

Thank you in advance.

Aucun commentaire:

Enregistrer un commentaire