Java-client: Appium code not working after updating java-client and selenium version

Created on 8 Sep 2018  路  5Comments  路  Source: appium/java-client

I have a piece of code that works fine with java-client(5.0.0-BETA6) and selenium-java version 3.3.1. But when i upgraded to java-client version 6.1.0 and selenium-java version 3.14.0, the code started throwing errors. Need help in fixing the issue.

 AndroidDriver<AndroidElement> driver=Base.capabilities();
 driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
 TouchAction t=new TouchAction(driver);
 driver.findElementByXPath("//android.widget.TextView[@text='Views']").click();
 driver.findElementByXPath("//android.widget.TextView[@text='Date Widgets']").click();
 driver.findElementByAndroidUIAutomator("text(\"2. Inline\")").click();
 driver.findElementByXPath("//*[@content-desc='9']").click();

 t.press(driver.findElementByXPath("//*[@content-desc='15']")).waitAction(2000).moveTo(driver.findElementByXPath("//*[@content-desc='45']")).release().perform();

The error i am getting is -

  1. TouchAction is a raw type. References to generic type TouchAction should be parameterized"
  2. The method press(PointOption) in the type TouchAction is not applicable for the arguments (AndroidElement)

Any help in resolving this will be appreciated. Thanks.

User side probleproblem of an external tool

All 5 comments

Thanks a lot. That helps in fixing the code that I had. But the changes are multiple. Is it very frequent that so many changes occur from one version to another. The code I had was almost completely changed in order for it to work. If changes between versions are so frequent then it would be very difficult to keep a track.

@vaibhav2701

If changes between versions are so frequent then it would be very difficult to keep a track

We first mark the methods deprecated and then remove in the next release.

https://github.com/appium/java-client/commit/dea2a7d4b4be0420c5a3c7aeeeb0a07dc7979f71

U jumped from 5.0.0-BETA6 to 6.1.0. Version 6.0.0 removed the deprecated methods.

You are right. I guess the jump between versions was indeed steep. :)

https://github.com/appium/java-client/blob/master/src/test/java/io/appium/java_client/ios/IOSTouchTest.java#L65-L70

Hi sai, facing the same issue...unable to resolve my java-cient version is 6.1.0

Was this page helpful?
0 / 5 - 0 ratings