Skip to main content
added 231 characters in body
Source Link

Error: Duplicate class org.openqa.selenium.SearchContext found in modules jetified-java-client-7.3.0.jar (java-client-7.3.0.jar) and jetified-selenium-server-standalone-3.141.59.jar (selenium-server-standalone-3.141.59.jar)

Please check my code in android studio for automation with selenium jar and aapium

package com.example.babilok;

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;

public class MainActivity {

    public static void main(String[] args) {

        // Set the Desired Capabilities
        DesiredCapabilities caps = new DesiredCapabilities();
        caps.setCapability("deviceName", "Redmi");
        caps.setCapability("udid", "e6c7eed472e00d89"); // Give Device ID of your mobile phone
        caps.setCapability("platformName", "Android");
        caps.setCapability("platformVersion", "9 PKQ1.190319.001");
        caps.setCapability("appPackage", "com.example.babilok");
        caps.setCapability("appActivity", "com.example.babilok.MainActivity");
        caps.setCapability("noReset", "true");

        // Instantiate Appium Driver
        try {

            AppiumDriver<MobileElement> Driver = new AndroidDriver<MobileElement>(new URL("http://0.0.0.0:4723/wd/hub"),
                    caps);

        } catch (MalformedURLException e) {
            System.out.println(e.getMessage());
        }
    }
}

Please check my android all jar files that i embed in image

Please check my code in android studio for automation with selenium jar and aapium

package com.example.babilok;

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;

public class MainActivity {

    public static void main(String[] args) {

        // Set the Desired Capabilities
        DesiredCapabilities caps = new DesiredCapabilities();
        caps.setCapability("deviceName", "Redmi");
        caps.setCapability("udid", "e6c7eed472e00d89"); // Give Device ID of your mobile phone
        caps.setCapability("platformName", "Android");
        caps.setCapability("platformVersion", "9 PKQ1.190319.001");
        caps.setCapability("appPackage", "com.example.babilok");
        caps.setCapability("appActivity", "com.example.babilok.MainActivity");
        caps.setCapability("noReset", "true");

        // Instantiate Appium Driver
        try {

            AppiumDriver<MobileElement> Driver = new AndroidDriver<MobileElement>(new URL("http://0.0.0.0:4723/wd/hub"),
                    caps);

        } catch (MalformedURLException e) {
            System.out.println(e.getMessage());
        }
    }
}

Please check my android all jar files that i embed in image

Error: Duplicate class org.openqa.selenium.SearchContext found in modules jetified-java-client-7.3.0.jar (java-client-7.3.0.jar) and jetified-selenium-server-standalone-3.141.59.jar (selenium-server-standalone-3.141.59.jar)

Please check my code in android studio for automation with selenium jar and aapium

package com.example.babilok;

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;

public class MainActivity {

    public static void main(String[] args) {

        // Set the Desired Capabilities
        DesiredCapabilities caps = new DesiredCapabilities();
        caps.setCapability("deviceName", "Redmi");
        caps.setCapability("udid", "e6c7eed472e00d89"); // Give Device ID of your mobile phone
        caps.setCapability("platformName", "Android");
        caps.setCapability("platformVersion", "9 PKQ1.190319.001");
        caps.setCapability("appPackage", "com.example.babilok");
        caps.setCapability("appActivity", "com.example.babilok.MainActivity");
        caps.setCapability("noReset", "true");

        // Instantiate Appium Driver
        try {

            AppiumDriver<MobileElement> Driver = new AndroidDriver<MobileElement>(new URL("http://0.0.0.0:4723/wd/hub"),
                    caps);

        } catch (MalformedURLException e) {
            System.out.println(e.getMessage());
        }
    }
}

Please check my android all jar files that i embed in image

code formatting
Source Link
pavelsaman
  • 4.5k
  • 1
  • 14
  • 37

Please check my code in android studio for automation with selenium jar and aapium

package com.example.babilok;

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;

public class MainActivity {


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;

public class MainActivity {

    public static void main(String[] args) {

        // Set the Desired Capabilities
        DesiredCapabilities caps = new DesiredCapabilities();
        caps.setCapability("deviceName", "Redmi");
        caps.setCapability("udid", "e6c7eed472e00d89"); // Give Device ID of your mobile phone
        caps.setCapability("platformName", "Android");
        caps.setCapability("platformVersion", "9 PKQ1.190319.001");
        caps.setCapability("appPackage", "com.example.babilok");
        caps.setCapability("appActivity", "com.example.babilok.MainActivity");
        caps.setCapability("noReset", "true");

        // Instantiate Appium Driver
        try {

            AppiumDriver<MobileElement> Driver = new AndroidDriver<MobileElement>(new URL("http://0.0.0.0:4723/wd/hub"),
                    caps);

        } catch (MalformedURLException e) {
            System.out.println(e.getMessage());
        }
    }
}

}

Please check my android all jar files that i embed in image

Please check my code in android studio for automation with selenium jar and aapium

package com.example.babilok;

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;

public class MainActivity {

public static void main(String[] args) {

    // Set the Desired Capabilities
    DesiredCapabilities caps = new DesiredCapabilities();
    caps.setCapability("deviceName", "Redmi");
    caps.setCapability("udid", "e6c7eed472e00d89"); // Give Device ID of your mobile phone
    caps.setCapability("platformName", "Android");
    caps.setCapability("platformVersion", "9 PKQ1.190319.001");
    caps.setCapability("appPackage", "com.example.babilok");
    caps.setCapability("appActivity", "com.example.babilok.MainActivity");
    caps.setCapability("noReset", "true");

    // Instantiate Appium Driver
    try {

        AppiumDriver<MobileElement> Driver = new AndroidDriver<MobileElement>(new URL("http://0.0.0.0:4723/wd/hub"),
                caps);

    } catch (MalformedURLException e) {
        System.out.println(e.getMessage());
    }
}

}

Please check my android all jar files that i embed in image

Please check my code in android studio for automation with selenium jar and aapium

package com.example.babilok;

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;

public class MainActivity {

    public static void main(String[] args) {

        // Set the Desired Capabilities
        DesiredCapabilities caps = new DesiredCapabilities();
        caps.setCapability("deviceName", "Redmi");
        caps.setCapability("udid", "e6c7eed472e00d89"); // Give Device ID of your mobile phone
        caps.setCapability("platformName", "Android");
        caps.setCapability("platformVersion", "9 PKQ1.190319.001");
        caps.setCapability("appPackage", "com.example.babilok");
        caps.setCapability("appActivity", "com.example.babilok.MainActivity");
        caps.setCapability("noReset", "true");

        // Instantiate Appium Driver
        try {

            AppiumDriver<MobileElement> Driver = new AndroidDriver<MobileElement>(new URL("http://0.0.0.0:4723/wd/hub"),
                    caps);

        } catch (MalformedURLException e) {
            System.out.println(e.getMessage());
        }
    }
}

Please check my android all jar files that i embed in image

I have edited my image for all jar files, please check
Source Link

Please check my code in android studio for automation with selenium jar and aapium

package com.example.babilok;

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;

public class MainActivity {

public static void main(String[] args) {

    // Set the Desired Capabilities
    DesiredCapabilities caps = new DesiredCapabilities();
    caps.setCapability("deviceName", "Redmi");
    caps.setCapability("udid", "e6c7eed472e00d89"); // Give Device ID of your mobile phone
    caps.setCapability("platformName", "Android");
    caps.setCapability("platformVersion", "9 PKQ1.190319.001");
    caps.setCapability("appPackage", "com.example.babilok");
    caps.setCapability("appActivity", "com.example.babilok.MainActivity");
    caps.setCapability("noReset", "true");

    // Instantiate Appium Driver
    try {

        AppiumDriver<MobileElement> Driver = new AndroidDriver<MobileElement>(new URL("http://0.0.0.0:4723/wd/hub"),
                caps);

    } catch (MalformedURLException e) {
        System.out.println(e.getMessage());
    }
}

}[![

]1]1

enter image description herePlease check my android all jar files that i embed in image

package com.example.babilok;

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;

public class MainActivity {

public static void main(String[] args) {

    // Set the Desired Capabilities
    DesiredCapabilities caps = new DesiredCapabilities();
    caps.setCapability("deviceName", "Redmi");
    caps.setCapability("udid", "e6c7eed472e00d89"); // Give Device ID of your mobile phone
    caps.setCapability("platformName", "Android");
    caps.setCapability("platformVersion", "9 PKQ1.190319.001");
    caps.setCapability("appPackage", "com.example.babilok");
    caps.setCapability("appActivity", "com.example.babilok.MainActivity");
    caps.setCapability("noReset", "true");

    // Instantiate Appium Driver
    try {

        AppiumDriver<MobileElement> Driver = new AndroidDriver<MobileElement>(new URL("http://0.0.0.0:4723/wd/hub"),
                caps);

    } catch (MalformedURLException e) {
        System.out.println(e.getMessage());
    }
}

}[![

]1]1

enter image description here

Please check my code in android studio for automation with selenium jar and aapium

package com.example.babilok;

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;

public class MainActivity {

public static void main(String[] args) {

    // Set the Desired Capabilities
    DesiredCapabilities caps = new DesiredCapabilities();
    caps.setCapability("deviceName", "Redmi");
    caps.setCapability("udid", "e6c7eed472e00d89"); // Give Device ID of your mobile phone
    caps.setCapability("platformName", "Android");
    caps.setCapability("platformVersion", "9 PKQ1.190319.001");
    caps.setCapability("appPackage", "com.example.babilok");
    caps.setCapability("appActivity", "com.example.babilok.MainActivity");
    caps.setCapability("noReset", "true");

    // Instantiate Appium Driver
    try {

        AppiumDriver<MobileElement> Driver = new AndroidDriver<MobileElement>(new URL("http://0.0.0.0:4723/wd/hub"),
                caps);

    } catch (MalformedURLException e) {
        System.out.println(e.getMessage());
    }
}

}

Please check my android all jar files that i embed in image

Source Link
Loading