Appium Training Forum

Returned value cannot be converted to WebElement element-6066-11e4-a52e-4f735466cecf1

S
Sineesh Post on 09/10/2018

Hello all,

I am getting error says "Returned value cannot be converted to WebElement: {element-6066-11e4-a52e-4f735466cecf=1}" when trying to click the button using UiSelector.

below is the Script:

File classpathRoot = new File(System.getProperty("user.dir"));
File appDir = new File(classpathRoot, "/Apps/");
File app = new File(appDir, "Bank 3_R3-d6bfb34f.apk");
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(CapabilityType.BROWSER_NAME, "");
capabilities.setCapability("deviceName", "9885e64e3449583847");
capabilities.setCapability("platformVersion", "8.0.0");
capabilities.setCapability("platformName", "Android");
capabilities.setCapability("app", app.getAbsolutePath());
capabilities.setCapability("appPackage", "com.zapp.bank.vanillaBank3.release");
capabilities.setCapability("appActivity", "com.zapp.bank.ui.activity.SplashScreenActivity");
@SuppressWarnings("rawtypes")
AndroidDriver driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
driver.manage().timeouts().implicitlyWait(80, TimeUnit.SECONDS);

Thread.sleep(2000);

driver.findElementByAndroidUIAutomator("UiSelector().resourceId(\"com.zapp.bank.vanillaBank3.release:id/register_btn\")").click();


if(driver!= null){
driver.quit();
}

I was able to launch the app by using above script, but its failing to find and click the button.

Please look into this and help me, its blocker for me.

Regards,
Sineesh.

A

Instructor

Ashish Thakur 4 days go

Hi Sineesh

Can you try the same with pure selenium command as shown in videos?