Closed vikramvi closed 7 years ago
@vikramvi Sorry for the late response.
I can't reproduce it. Could you try it with 5.0.2
This sample was compiled successfully
package com.saucelabs.appium;
import io.appium.java_client.AppiumDriver;
import io.appium.java_client.MobileElement;
import io.appium.java_client.remote.MobileCapabilityType;
import io.appium.java_client.remote.MobilePlatform;
import org.junit.Test;
import org.openqa.selenium.remote.DesiredCapabilities;
import java.io.File;
import java.net.URL;
public class SomeSample {
@Test
public void tezt() throws Exception {
File app = new File("The absolute or relative path to an *.apk file");
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "Android Emulator");
capabilities.setCapability(MobileCapabilityType.APP, app.getAbsolutePath());
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, MobilePlatform.ANDROID);
AppiumDriver<MobileElement> driver = new AppiumDriver<>(
new URL("http://target_ip:used_port/wd/hub"),
capabilities);
}
}
@vikramvi And something like that is compiled too
@TikhomirovSergey thanks for clarifying.
Tried this still not working kindly help
@Annu1-cmd could you please provide details?
@valfirst I am using eclipse ide for java developers 4.6.0 Appium server version 1.13 Java version 1.8.0_271 TestNg 6.10 Node js v12.18.3 OS of pc windows 10 Mobile platform android 10
@Annu1-cmd sorry, that's not enough, could you please provide an SSCCE (Short, Self Contained, Correct (Compilable), Example) ?
Should I share the code sample too?
@Annu1-cmd the project, the steps to run, the error details and etc., in other words everything that could be helpful to reproduce the problem
import java.net.URL; import java.util.concurrent.TimeUnit;
import io.appium.java_client.AppiumDriver; import io.appium.java_client.MobileElement; import io.appium.java_client.remote.MobileCapabilityType; import io.appium.java_client.remote.MobilePlatform; import org.junit.Test; import org.openqa.selenium.By; import org.openqa.selenium.remote.DesiredCapabilities;
public class Grocery60 {
public static void main(String[] args) {
// TODO Auto-generated method stub
try {
openGrocery();
} catch (Exception e) {
// TODO Auto-generated catch block
System.out.println(e.getCause());
System.out.println(e.getMessage());
e.printStackTrace();
}
}
public static void openGrocery() throws Exception
{
DesiredCapabilities cap=new DesiredCapabilities();
cap.setCapability("deviceName", "One Plus 7");
cap.setCapability("udid","98cd1718");
cap.setCapability("platformName", "ANDROID");
cap.setCapability("platformVersion", "10");
cap.setCapability("automationName","UiAutomator2");
cap.setCapability("appPackage", "com.grocery60.inc.grocery");
cap.setCapability("appActivity", "com.grocery60.inc.grocery.ui.SplashActivity");
URL url=new URL("http://127.0.0.1:4723/wd/hub");
AppiumDriver<MobileElement> driver = new AppiumDriver<MobileElement>(
new URL("http://target_ip:used_port/wd/hub"),cap);
I ran this on eclipse and I got this error The type AppiumDriver is not generic; it cannot be parameterized with arguments
@Annu1-cmd it's still not enough, please, follow guidelines carefully: SSCCE (Short, Self Contained, Correct (Compilable), Example)
Hello, i'm facing the same issue in my MacPro system.
` import java.net.MalformedURLException; import java.net.URL; import org.openqa.selenium.remote.DesiredCapabilities; import io.appium.java_client.ios.IOSDriver; import io.appium.java_client.remote.AutomationName; import io.appium.java_client.remote.MobileCapabilityType; import io.appium.java_client.ios.IOSMobileCommandHelper; import io.appium.java_client.AppiumDriver; //ERROR 1 import org.openqa.selenium.WebElement;
public class base {
public static void main(String[] args) throws MalformedURLException {
// TODO Auto-generated method stub
DesiredCapabilities d = new DesiredCapabilities();
d.setCapability(MobileCapabilityType.DEVICE_NAME, "iPHONE 11 pro");
d.setCapability(MobileCapabilityType.PLATFORM_NAME, "IOS");
d.setCapability(MobileCapabilityType.AUTOMATION_NAME, AutomationName.IOS_XCUI_TEST);
d.setCapability(MobileCapabilityType.APP, "//users//desktop/UICatelog.app");
IOSDriver<IOSElement> driver = new IOSDriver<> (new URL("\"http://127.0.0.1:4723/wd/hub\""),d);
}
}
Error message is here :
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
The type IOSDriver is not generic; it cannot be parameterized with arguments
at base.main(base.java:35)`
I got the issue it was due to Java Client Version, i was used java client lates version 8.0 beta once i have used 7.6, it is working .
<artifactId>java-client</artifactId>
<version>7.6.0</version>
Don't use the latest java_client, use java_client 7.6.0 and your problem will be gone
Don't use the latest java_client, use java_client 7.6.0 and your problem will be gone
What can be the resolution if we have to use latest version 8.1.1 only?
Please, read "Migration Guide", there you'll be able to find the resolution to the error from https://github.com/appium/java-client/issues/700#issuecomment-1054218255
Please, read "Migration Guide", there you'll be able to find the resolution to the error from #700 (comment)
i have read the doc, but i couldn't understand most of it. can you suggest something(like an explanation form ur side)
same issue in C# any help please ?
Description
Environment
Details
Please provide more details, if necessary.
Code To Reproduce Issue [ Good To Have ]
Please remember that, with sample code; it's easier to reproduce bug and much faster to fix it. You can git clone https://github.com/appium/sample-code or https://github.com/appium/sample-code/tree/master/sample-code/apps and reproduce an issue using Java and sample apps. Also you can create a gist with pasted java code sample or put it here using markdown. About markdown please read Mastering markdown and Writing on GitHub
Ecxeption stacktraces
NA
Link to Appium logs
NA