Hi,
I am trying to scroll down the Raaga app on android tab and its not working as expected. Here is the code and error.
Code:
import java.net.MalformedURLException;
import java.net.URL;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.remote.DesiredCapabilities;
import io.appium.java_client.TouchAction;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.android.AndroidElement;
import io.appium.java_client.remote.AndroidMobileCapabilityType;
import io.appium.java_client.remote.MobileCapabilityType;
public class Raaga {
public static void main(String[] args) throws MalformedURLException, InterruptedException {
DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
desiredCapabilities.setCapability(MobileCapabilityType.DEVICE_NAME, “device”);
desiredCapabilities.setCapability(AndroidMobileCapabilityType.APP_ACTIVITY, “com.raaga.android.SplashScreen”);
desiredCapabilities.setCapability(AndroidMobileCapabilityType.APP_PACKAGE, “com.raaga.android”);
AndroidDriver driver = new AndroidDriver<>(new URL(“http://127.0.0.1:4723/wd/hub”),desiredCapabilities);
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
TouchAction touchAction = new TouchAction(driver);
touchAction.tap(driver.findElementById(“com.raaga.android:id/skip_login_btn”)).perform();
AndroidElement notify = driver.findElementByAndroidUIAutomator(“text(“OK, Got it”)”);
touchAction.tap(notify).perform();
touchAction.tap(driver.findElementByAndroidUIAutomator(“text(“Tamil”)”)).perform();
Thread.sleep(5000);
driver.findElementByAndroidUIAutomator(“new UIScrollable(new UISelector()).scrollIntoView(text(“Love Songs”));”);
touchAction.tap(driver.findElementByAndroidUIAutomator(“text(“Moments Of Love 2017”)”)).perform();
}
}
Error:
[debug] [AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:"-android uiautomator",“selector”:“new UIScrollable(new UISelector()).scrollIntoView(text(“Love Songs”));”,“context”:"",“multiple”:false}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:"-android uiautomator",“selector”:“new UIScrollable(new UISelector()).scrollIntoView(text(“Love Songs”));”,“context”:"",“multiple”:false}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: find
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding ‘new UIScrollable(new UISelector()).scrollIntoView(text(“Love Songs”));’ using ‘ANDROID_UIAUTOMATOR’ with the contextId: ‘’ multiple: false
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Parsing selector: new UIScrollable(new UISelector()).scrollIntoView(text(“Love Songs”))
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:9,“value”:“Could not parse UiSelector argument: UiSelector has no new UIScrollable method”}
[debug] [AndroidBootstrap] Received command result from bootstrap
[HTTP] <-- POST /wd/hub/session/f95b7438-ed60-47af-8309-08f060b36cc3/element 500 28 ms - 221